Cache class: Fix crash on data race on Windows. (#12579) (#12595)
* Cache class: Fix crash on data race on Windows.
On Windows, the error gets mapped to a different
errno when a race happens, see
https://github.com/python/cpython/blob/cecd6012b0ed5dca3916ae341e705ae44172991d/PC/errmap.h#L107.
Therefore, we were observing crashes from that
code path, as the error wasn't being handled,
but bubbled up.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
(cherry picked from commit 9de29bfe1b02e5b9924dac06ed24ecbaa7b192a5)
Co-authored-by: Cornelius Riemenschneider <criemen@github.com>