Floyd Mayweather Jr maintained his perfect record with a controversial fourth-round knockout of Victor Ortiz.