Fix check for terminal output.

Previously, 26b4a492 fixed which stream was being checked, but the
surrounding check for whether it is nil was testing the wrong
variable.

Signed-off-by: Ewen Cheslack-Postava <me@ewencp.org>