I'd suggest improving the error message (and I'll provide a patch).
Currently the error says:
ERROR: Unexpected error in launching a slave. This is probably a bug in Jenkins
A better message would say something like:
ERROR: Failed to properly communicate with agent. This could be because a program (especially an additional ssh command before the one used to start agent.jar) consumed input which was destined for the agent. -- Otherwise, this could be a bug in Jenkins.
Beyond that, it seems to me like the Jenkins server side should be able to wait for the agent's hello world message and only start sending bytes upon receiving that. Presumably that would fix the problem here.
(FWIW, I just hit this today running 2.97.)