Added functions to spin-lock on an atomic_flag.

Added atomic_flag_spin_lock and atomic_flag_spin_lock_backoff
functions, as well as their explicit variants. The former version
does test-test-and-set locking, the latter does test-and-set with
exponential backoff. Testing shows that exponential-backoff version
is the better performer on high-contention locks, but the non
backoff version might be useful for low-latency fastpaths.

Also renamed the atomic_pause function to atomic_yield, and added
an atomic_yield_backoff function which implements an exponential-
backoff algorithm currently tuned for x86/x64 platforms.

Additionally, the generic atomics implementation was cleaned up
and the malloc_allocator and page_allocator singleton instances
were modified to use a double-checked locking/initialization
pattern, in order to solve a pure-virtual call bug occuring on
calls to exit or SIGTERM being raised.