Don't close main window when game is running. Fixes #528, partial fix for #521