Fix #637. Avoid tput if TERM is 'unknown'