Cleanup: use the index table to store locks.