Make it compile on Win32 without pthreads: Use a Win32 critical section