file(LOCK) not working correctly on windows
Situation:
Two Windows Pipelines running a cmake process at the same time trying to lock the same folder doesn't seem to work 100% of the time.
Observation:
Rarely, the lock does not seem to make one of the pipelines wait for the lock and both process run as if the lock was acquired by both of them.
Of course this is kind of unexpected and leads to errors down the pipeline.
The locking code is given here:
https://gitlab.kitware.com/cmake/cmake/-/blob/v3.30.5/Source/cmFileLockWin32.cxx#L81-L87
where
`static OVERLAPPED overlapped;` is not initialized.
The docs of [FileLockEx](https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-lockfileex) explicitly mention:
> A pointer to an OVERLAPPED structure that the function uses with the locking request. This structure, which is required, contains the file offset of the beginning of the lock range. You must initialize the hEvent member to a valid handle or zero.
The initialization of the member to zero is clearly missing and in general the OVERLAPPED structure should be initialized to zero as mentioned in the [OVERLAPPED](https://learn.microsoft.com/en-us/windows/win32/api/minwinbase/ns-minwinbase-overlapped) docs
The same applies to https://gitlab.kitware.com/cmake/cmake/-/blob/v3.30.5/Source/cmFileLockWin32.cxx#L18
The code probably should use probably use one of the wait [functions](https://learn.microsoft.com/en-us/windows/win32/sync/wait-functions) or [GetOverlappedResult](https://learn.microsoft.com/en-us/windows/win32/api/ioapiset/nf-ioapiset-getoverlappedresult) instead of retrying every 1s
issue