tdb: use asprintf() to simplify tdb_summary()