sshpeer: factor out code for creating peers from pipes
An upcoming commit will want to instantiate an SSH peer via
an alternate mechanism that doesn't require running a new
`ssh` command. To facilitate that, we extract the code for
creating a peer from pipes to its own function.
Differential Revision: https://phab.mercurial-scm.org/D2391