HPCC-12053 Index writes were broken by last change.

Index (+ keydiff/keypatch) writes were incorrectly testing for
TDX* flags, as a consequence they were incorrectly mangling the
output filenames with temporary scopes, which could not be found
on lookup

Signed-off-by: Jake Smith <jake.smith@lexisnexis.com>