Fix a deadlock.

When the auto-save thread kicked off at the end of the game, it could
sit there waiting for a screenshot that would never be taken. This
fixes that, both by taking the screenshot and adding timeouts
that should prevent eternal pauses.