7c13481ede
When logging out, we should first handle network level logout and after that ensure the client is disconnected before removing state to avoid having event handling during disconnect from touching anything anymore. I don't know why we nilled the client but since so many places use it we'd rather get errors rather than panics if it's being used after logging out but previous lifecycle fixes should avoid that.