channels1: Fix severa possible null pointer dereferences.
channels1: Fix severa possible null pointer dereferences.

(cherry picked from commit b811b89f57ec167612948e688d75015f85b9c8f4)

mwgoldsmith/libssh,mwgoldsmith/libssh,mwgoldsmith/ssh,mwgoldsmith/ssh,mwgoldsmith/ssh,mwgoldsmith/ssh,mwgoldsmith/libssh,mwgoldsmith/libssh