Fix force close bug

Deleting a category that is currently selected in MainActivity would
cause the app to crash indefinitely. This has been fixed in 2 places:

1. For people currently with the bug, MainActivity checks to make sure
   the category exists, instead of assuming it does.
2. To prevent future occurrences, EditCategoriesActivity will now
   change the prefs if the category being deleted is the selected one.