Fix Term.MODE setting under Python 3 in case of incapable tty stdout.

The bug was introduced in 86b3838b605cef56bfe6f51d425835bcf9bcb50a. I noticed it by coincidence and arranged with @jsilhan to fix it.