Add shared locks and revocable shared lock support.

Care was taken to ensure no changes would be required to existing
lock.py users. To this end, the existing lock.py tests were not modified
and instead a new test class was added to cover the new functionality.