I wanted to submit a PR for this but I don't really have time anymore.
It would be nice if the pthread_rwlock functions were implemented in library_pthread_stub.js (like mutexes are) so that code that uses rw locks can be used in a single-threaded context.