gthread: Introduce GAtomicLock and GAtomicRecLock spin-lock

Locks can be implemented by using native OS mutexes or can relying on
CPU features to only use atomic operations to enter in critical areas.

While GMutex has an internal implementation that uses this, it's not
exposed as public API and it has some complications as it's also meant
to be used with GCond's.

We can instead expose a public API that is guaranteed to only use atomic
logic, at least when G_ATOMIC_LOCK_FREE is defined.
9 jobs for atomic-spin-locks in 27 minutes (queued for 2 minutes and 4 seconds)
latest