Rename object function *_lock to *_get_locked

The new name better reflects what the function does.