Use lock to prevent concurrent access to ZKDatabase when shuting down quorum peer