Fix login/logout issues

Previously when a user logged out the back stack of activities for the user logging out would still remain. This caused issues like #142 and #149.  After this fix the old user's activities will shutdown properly when/if they are restarted.