Add our own read-write lock implementation, that returns an error to the callback when the lock cannot be acquired