[JENKINS-23471 JENKINS-24050]

Integrated the fix in remoting to Jenkins 1.580.