On Windows, we keep using our own implementations, because GCC
implements std::mutex and std::condition_variable with pthread
emulation, which is not a good choice.
Use CRITICAL_SECTION and CONDITION_VARIABLE. This requires Windows
Vista or newer. It fixes problems with GLib threading objects that
were implicitly created by static constructors before g_thread_init().