Add warnings for not storing readLock/writeLock()

The lock persists only as long as the returned object persists, so
calling readLock() or writeLock() without storing the returned object is
a bug.
Documentation fix for previous code change
Redid/fixed locking code
Fixed bug: lock wasn't being held!