Win32: rework mutex/condition implementation.