thread: add generic futex-based muteces
This provides a common implementation of fast (non-debug),
error-checking (debug) and recursive muteces on top of
vlc_atomic_wait() and vlc_atomic_notify_one(), using Drepper's tristate
mutex algorithm.
Benefits of this implementation include:
- Error checking is supported on all platforms (including Windows).
- Initialization can never fail, is not subject to aborts.
- Destruction is a no-op and can be removed altogether.
- Static muteces do not leak or need kludges.
- Ownership can be checked directly without the mutex mark system.
- Non-ownership can be checked in assertion.
Because the player code uses the same vlc_mutex_t typedef for both
non-recursive and recursive usages, disentanglement is not possible.
This patchset thus supports both semantics together as before.