Fix regression with testport -i causing empty TERM since [5b2608fcc7]

Reported by:	gusi on freenode