fixes issue leeter/hexchat#3 chanopts not saved if user uses /quit before exiting

fixes issue leeter/hexchat#3 chanopts not saved if user uses `/quit` before exiting. This is the C fix, unfortunately a proper fix, e.g. removing the dependency on `session_name` all together is a much vaster refactor outside the scope of this bugfix. More importantly the dependency on `session::channel` which is cleared by the `/quit` command to indicate that the session is no longer active.