Fix a bug where an exception is thrown if accessing WindowsMessageBox on a thread other than the main thread.