Factor out the ssh connection stuff from send-pack.c