So chances are I introduced a problem here with this nxagent patch 522106e207e7230da5e62fb88f2e47742fdf1b21. What do you think, Mihai? Can you reproduce the crash?
Turns out that I cannot test this right now.
libssh doesn't let me connect to my test server in question because the ssh-agent is too old and doesn't support the newer signature algorithms libssh and the remote OpenSSH server agree on. Looks like I have to fix libssh first...
Mihai