Fix null checking in libssh2