Simplify locking code
Simplify locking code

ceejatec/sync_gateway,couchbaselabs/sync_gateway,couchbaselabs/sync_gateway,couchbaselabs/sync_gateway,ceejatec/sync_gateway,ceejatec/sync_gateway,couchbaselabs/sync_gateway,ceejatec/sync_gateway