[Win32] Actually fix win32 corruption and fix a memory leak.