Upgrade, enable stdout log only if pseudo-tty is enabled

When user runs fuel upgrade script in no-tty mode
and then closes stdout (for example suspends ^Z the process),
during some time (i.e. when buffer is over) it hangs on
writing to stdout.

blueprint upgrade-to-5-1
Closes-bug: #1336218
Change-Id: I42af9c59e6a5e10645c8e59d13dfa111da53851d
Merge "Upgrade, enable stdout log only if pseudo-tty is enabled"