messages: Added missing NULL pointer checks.
messages: Added missing NULL pointer checks.

Found by clang-analyzer http://test.libssh.org/clang-analyzer/

substack/libssh,mwgoldsmith/ssh,robxu9/libssh,sebadoom/libssh,nviennot/libssh,elastichosts/libssh,rofl0r/libssh,nviennot/libssh,taikoo/libssh,jahrome/libssh,jt1/honeypot-libssh,DouglasHeriot/libssh,substack/libssh,taikoo/libssh,pouete/libssh,taikoo/libssh,jahrome/libssh,kedazo/libssh,wangshawn/libssh,substack/libssh,mwgoldsmith/libssh,sebadoom/libssh,Distrotech/libssh,miloj/libssh-v0.5,jt1/honeypot-libssh,mwgoldsmith/libssh,nviennot/libssh,wangshawn/libssh,substack/libssh,jt1/honeypot-libssh,kedazo/libssh,DouglasHeriot/libssh,pouete/libssh,rofl0r/libssh,sebadoom/libssh,kedazo/libssh,robxu9/libssh,mwgoldsmith/ssh,bigcat26/libssh-mod,mwgoldsmith/libssh,miloj/libssh-v0.5,rofl0r/libssh,DouglasHeriot/libssh,wangshawn/libssh,bigcat26/libssh-mod,robxu9/libssh,wangshawn/libssh,pouete/libssh,robxu9/libssh,bigcat26/libssh-mod,jahrome/libssh,elastichosts/libssh,jahrome/libssh,sebadoom/libssh,mwgoldsmith/ssh,jt1/honeypot-libssh,mwgoldsmith/ssh,DouglasHeriot/libssh,miloj/libssh-v0.5,pouete/libssh,nviennot/libssh,mwgoldsmith/libssh,Distrotech/libssh,rofl0r/libssh,kedazo/libssh,bigcat26/libssh-mod,taikoo/libssh,Distrotech/libssh,Distrotech/libssh,elastichosts/libssh,miloj/libssh-v0.5