def closed(self):
        session.SSHSession.closed(self)
        self.client = None
This is reliably called on session close/disconnect and calls the avatar
dataset/ETHPy150Open cowrie/cowrie/cowrie/ssh/session.py/HoneyPotSSHSession.closed