pthread: implement reader/writer lock

Add a POSIX conforming, fair reader/writer implementation.

See ["The Open Group Base Specifications Issue 7": pthread_rwlock_destroy, pthread_rwlock_init][posix].

  [posix]: http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_rwlock_init.html