Fix condition to check whether or not the database needs upgrading
Add check to display database upgrade screen to more activities

Through shortcuts, widgets, etc. users can start the app using another
activity than Accounts. We still want to display the database upgrade
screen in such cases.