Fix eating all memory if stdout is not a tty.
changes 1.10.5