Fix windows on Windows

Moved the window and context creation from the window constructor to
the window's main loop thread. We now wait in the constructor until the
graphics context is created.