tdb: consolidate tdb allocation code - re-use dead records at hash top.