refs.c: rework ref_locks by abstracting from underlying struct lock_file