Add Lock#with_lock locking primitive