Moved userdata cleanup before logout notification

User data were removed after logout notification was posted. With that, if any code responding to notification used `isLoggedIn` could not run reliably. 

I propose to reverse the order. That way every logout-notification-responding code will have access to a true `isLoggedIn` value.