tty: set isTTY to false if TERM is 'dumb'

This is mainly to stop REPLs/logs from spitting ANSI control codes on
terminals which don't support them. (q.v. issue #5344)