Fix win32 build and cleanup JThread