Fix end game window conflicting with ingame menu

Fixes #6311