Fix advisory locking in client library