fixing JENKINS-22493 (https://issues.jenkins-ci.org/browse/JENKINS-22493)
improving the error-checking when receiving a response from the remote build server