refs.c: verify_lock should set errno to something meaningful