Fix engine running after game death.

If the GameThread got interrupted rather than Game.update throwing
an Exception, we'd still be running the GameEngine. Now at least
when using GameEngine.mainLoop(), this should be taken care of.
Split GameEngine.mainLoop() implementation into separate methods.