Try to keep a constant game speed when rendering can't keep up

Fixes #985

This should handle 99.9% of slow-down, where logic would happen slower in
realtime. The 0.1% of cases where slow-down can still happen is when the
time for a frame to complete goes over a certain threshold (e.g. frames
where we load game data; this is explained more in the source comments).