tdb: factor merge_with_left_record() out of tdb_free()