implement similar lifecycle for socks sessions as for socks server

Similar ideas to:
https://github.com/uProxy/uproxy-networking/pull/137

A SOCKS session lives as long as its TCP connection and datachannel.
Agreed. I've renamed `Session.onceClosed` to `Session.onceStopping`, as per the server. Now  server and session both have:

`onceReady` -> `onceStopping_` -> `onceStopped`

I've also renamed `shutdown_` to `stopResources_` which is more specific and descriptive.

I've found `onceStopping_` useful to provide a hook for external classes to terminate the server or session, in addition to the various ways it can terminate abnormally. Can you think of another way to do that?