ssh_do_close() was only closing about half the channels. Fixed.