Before this patch ssh2 and test_ssh2 returned success even if the session failed at `libssh2_session_handshake()` or after. This patch depends on cda41f7cb8, that fixed running test_ssh2 on Windows via sshd_fixture. Cherry-picked from #1017
cda41f7cb8