Add a bit more space for the smoothness hackery.

Prevents a buffer overflow error I was getting randomly.
Fix crash on File -> Exit in some cases.

Fixes #2537.
Merge pull request #2540 from unknownbrackets/windows-ui

Fix a couple crashes on shutdown