Fix an issue preventing the polling thread from stopping on logout.
Fix a crash that sometimes happens when gettingCards.