testsuite: Simplify Python <3.5 fallback for TextIO

Authored by bgamari on Fri, Nov 22, 12:26 PM.