tdb2: add write flag to tdb_direct