channel: check for closed state in waitwindow loops
channel: check for closed state in waitwindow loops

Signed-off-by: Jon Simons <44f878afe53efc66b76772bd845eb65944ed8232@jonsimons.org>
Reviewed-by: Andreas Schneider <5be00ddc76278cf6077f5047ca3384a88460c671@cryptomilk.org>

sebadoom/libssh,pouete/libssh,taikoo/libssh,elastichosts/libssh,nviennot/libssh,elastichosts/libssh,robxu9/libssh,sebadoom/libssh,pouete/libssh,Distrotech/libssh,nviennot/libssh,taikoo/libssh,robxu9/libssh,taikoo/libssh,mwgoldsmith/libssh,pouete/libssh,DouglasHeriot/libssh,Distrotech/libssh,mwgoldsmith/libssh,kedazo/libssh,sebadoom/libssh,mwgoldsmith/ssh,wangshawn/libssh,DouglasHeriot/libssh,kedazo/libssh,kedazo/libssh,pouete/libssh,Distrotech/libssh,kedazo/libssh,elastichosts/libssh,robxu9/libssh,DouglasHeriot/libssh,robxu9/libssh,nviennot/libssh,Distrotech/libssh,DouglasHeriot/libssh,wangshawn/libssh,mwgoldsmith/libssh,wangshawn/libssh,mwgoldsmith/ssh,mwgoldsmith/ssh,sebadoom/libssh,taikoo/libssh,wangshawn/libssh,mwgoldsmith/ssh,mwgoldsmith/libssh,nviennot/libssh