[channels] Small improvements

Testing with `instanceof` is better than only `typeof`.
Close all channels on logout.
Fixed syntax.