This makes it so that the stdin TTY-wrap stream gets ref'ed on
.resume() and unref'ed on .pause()
The semantics of the names "pause" and "resume" are a bit weird, but the
important thing is that this corrects an API change from 0.4 -> 0.6
which made it impossible to read from stdin multiple times, without
knowing when it might end up being closed. If no one has it open, this
lets the process die naturally.
LGTM'd by @ry
This modifies the TTYWrap constructor to add another argument specifying if
it's a readable or writable TTY . That is stdin or stdout. If a TTYWrap is
not readable then writes to it are blocking.
This makes process.stdout blocking.