Code to log and mitigate issue JENKINS-16824

Changes to log, mitigate or possibly fix (not confirmed) this issue: https://issues.jenkins-ci.org/browse/JENKINS-16824

New pull request to replace this: https://github.com/jenkinsci/remoting/pull/12