lib/ldb: Use tdb_parse_record and a callback rather than tdb_fetch()