rwlock implementation (untested!)

Two variants of reader writer locks, one based on sleeping kthreads with
condition variables, and one based on spinlocks.

The semantics of these rw locks give preference to readers
over writers if there are any readers waiting to enter the lock.