Both `_spin_lock_try` and `_spin_unlock` are private and deprecated
APIs, which are not exported by any headers in the SDK. The build fails
because the configure script does not define the functions before
calling them, which is treated as error by clang 16.
This patch replaces use of those APIs with `os_unfair_lock`, which is
the recommended replacement per the deprecation messages.