Fixed threading for win32api