Win32: fix malloc when creating a thread