Fix Win32 message loop to stop the framework