On RPC I/O failure, close the control pipe (which kills the agent)
On RPC I/O failure, close the control pipe (which kills the agent)

 - Also: ensure that the duplication of the process/thread handles can't
   leak a handle.

rprichard/winpty,rprichard/winpty,rprichard/winpty,rprichard/winpty