fix crash when disconnecting a spasm account but leaving the chat window open (PIDGIN-17578)
Testing Done:
Did the steps from the issue description while running in valgrind. No crash and no invalid read.
Bugs closed: PIDGIN-17578
Reviewed at https://reviews.imfreedom.org/r/1243/