lib/python/: add rwlock.py

A simple, first-in-first-out implementation of read-write locks