Move SAFE_FREE into tdb.c to stop exporting it into tdb.h namespace.