Sunderland climbed out of the bottom three with a controversial 4-0 win over 10-man Cardiff in their relegation showdown at the Stadium of Light.