properly synchronize chans mutable map when quitting in session

There's a small race condition in the Session#quit() method where the `mutable.Map` of channels is not properly synchronized during iteration. The other methods that modify the `chans` map are properly synchronized. Just noticed this when browsing the code. The other changes are just minor imports / cleanup.