Fixed crash that could occur when calling Game::exit() from a script function, due to the order of subsystem finalization and destruction.