Clean up the Windows runloop code