Atomic cmpxchng for subpart of a 32 or 64 bit value.
Added a new "bitlock" abstraction.

2 bits out of a 32 bit or 64 bit values can be used as a lock. One for lock
and one to indicate waiters. The waiters are all kept on common lists. The hashing
of lock address to wait list is rather simple and we should put a simple crc lookup
table there instead.
Add trylock variant to bit locks.
Add async locking for lw_mutex.
Tidied up code a little. The thread_event_init/destroy fucntions do not belong in the .h
file as generally accessible. They are really only meaningful for the default domain
which uses pthread mutex+cv to implement them. As such added API functions for it to the
domain (thread_event_init/destroy).

Still to do: the waiter structure should have the thread_event be the last field as it will make
custom domains that extend thread_event easier to write. They won't have to split their state for the
thread event itself in 2 parts: one at the top with the thread_event and the rest extending the waiter_t
structure. Also, still longer term, the waiter_t itself should not dictate that the event be a thread_event.
It really just needs a base event there. Rest is really for the default domain to dictate.
Removed stray references to DD.
Move thread event to be last field of waiter.

Next step: make it a base event and hide all thread_event specific stuff in lw_waiter.c
Make waiter struct only have a base event and completely hid thread_event
within the waiter.c file's global/default domain definition.
Use of CLOCK_MONOTONIC was turned off for some reason. Turning it back on.
Change bitlock API to take in lock and wait mask.

It is a more convenient api when carving bitfields, less error prone as one can never
specify an index to exceed word size, and avoids the internal conversions from idx -> mask.
Add bitlock support to lw_condvar.
Add async locking to bitlocks.
Clarified name of module init/deinit functions. Added init/destory function for
bitlocks.
fix bug in bitlock code. add some more apis.
fixed swap with mask code to do the right thing: retry if masked bits change.
More tweaks to bitlocks. Will need more adjustment. Also added intergrated
cv bit to bitlocks.
bit lock rekey to move waiters from one location to another.
Figured the best solution for unlocking: deferred unlock which returns waiter instead of waking it up.
big ball of mess monitor implementation. Unlikely that any of this works and it is certainly 0 tested.
Need to test bitlocks first and then this. Will likely just change this to a simple hash table of locks scheme.
Clean up handling of waiter_src.

Instead of event signal always clearing it, it is left untouched.  the owner of
the waiter has to clear it. This is better and proper and also lets lock APIs
not have to pass back a value to indicate if caller needs to wait or not.
Examining the wait_src for a non-null value can suffice. This also led to a
a couple of bugs being found and fixed.
Fixes resulting from testing bitlocks.

Fixes all over the place. Basic bitlock test passes including use of
cv bit. The more obscure API is better tested via monitors.