Added window closing hooks to ThreadManager.
Bugfix: Unnecessarily large render targets if RootWindow starts smaller
than
1024x768.