Support streaming output

Use PTY.spawn to stream out put of the executed commands
in real time.

This includes the fixes requested by @sethvargo.