__ulock_wait / __ulock_wake are considered private APIs and
their use will result in rejection from the App Store.
libc++ comes natively on Apple platforms, but some projects
prefer to static link their own libc++ builds.
So, add a CMake option to disable the use of __ulock_wait
on Apple platforms.
Also fix an issue where __ulock_wait code-path is actually not used
due to a missing include.