Fix crash with invalidated iterators after erase.

Cannot do a proper range-based-for while erasing from underneath.
Improve stream_channel::stop().
Set channel state to disconnected in destructor.