Fix issues in Windows discovered using CI Fix behavior of TryLock() so that it doesn't return an error when the file is already locked.