Avoid a race condition during game shutdown.

Hoping this is it.
Merge pull request #6106 from unknownbrackets/ui-tweaks

Avoid a race condition during game shutdown