d2/tfile.h: Call ungetc() when test for non-primary transformation command fails.