Fix thread naming and mutex logging for windows.