Fix threaded debugging on MSVC