See PR43425:
https://bugs.llvm.org/show_bug.cgi?id=43425
When writing profile data on Windows we were opening profile file with exclusive read/write access.
In case we are trying to write to the file from multiple processes simultaneously, subsequent calls to CreateFileA would return INVALID_HANDLE_VALUE.
To fix this, I changed to open without exclusive access and then take a lock.
Does lprofLockFd work on Windows? It looks like it just calls flock() but I didn't know that's a Windows thing?