tdb: defragment the freelist in tdb_allocate_from_freelist()