[Sanitizer tests] Fix most of the build problems on Windows

E.g. use the pthread helpers introduced in r208674