Shutdown socket write if stdin is not tty.