Make stdout swapping more reliable.

This matches fb65a2c3c8584a9ac4daa49ecbce7a540dc7f5a5 in remoting.
Integrated a new version of remoting
Integrated the new trilead library that has some minor diagnosability improvements.
SSH slave 1.9 brings in a better error diagnostics.