tdb2: close memory leak in tdb_check()