tdb: Factor out tdb_lock_covered_by_allrecord_lock from tdb_lock_list