r848: convert lib/tdb into the same layout as lib/ldb