Fix #6477 by sleeping for 16ms when minimized.
Qt: Drop QtMultimedia dependency if SDL is used. Force OSX10.9 SDK. Should fix #5835
Correct cyclesLate if an event consumes cycles.

This can prevent things from drifting out of sync.
Fix periodic events drifting when eating cycles.

Need to set the next timer before rescheduling threads or etc.
Add some missing algorithm includes.