TIMOB-12828 Make sure logout is done on main thread now.

Test is in JIRA. Credit goes to bhatfield for the fix.