tdb: cleanup: rename global_lock to allrecord_lock.