PR 1706 plus error reporting cleanups

This fixes the merge conflicts in #1706 (SSH credential crash) and brings the rest of the error reporting in `src/transports/ssh.c` up to the base standards for libgit2. @tiennou suggests going further with the error reporting by using libssh2's `libssh2_session_last_error` function, which I think is a great idea, but I wanted to give him a base version of ssh to start with that at least checked and reported errors in the right places.