On some platforms, the game will crash if SDL attempts to render to the
screen/window while the game is backgrounded. To prevent this, stop
rendering when the game enters a background state and resume rendering
when the game enters a foreground state.
Create the main thread via host rather than being a global variable in
base; this way, no base threads are created before the host runs main()
because that can cause issues on some platforms.