Fix for deadlock on win32