Cleanup jthread and fix win32 build