Fix crash when Thunderbird disconnects