[llvm][macos] Fix usage of std::shared_mutex on old macOS SDK versions

When setting CMAKE_CXX_STANDARD to 17 and targeting a macOS version
under 10.12 the ifdefs would try to use std::shared_mutex because
the of the C++ standard. This should also check the targeted SDK.

See discussion in: https://reviews.llvm.org/D130689

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D131063

GitOrigin-RevId: 4b8db17c32e04a1fe17440a6fb80aa96f31ff068
1 file changed