Fix locking calls to avoid taking re-entrant read locks

Fixes couchbase/couchbase-lite-ios#500 (I think)