Fix potential NPE.

SettingsActivity accesses AppPreferences without initializing it, so
better make sure it's initialized before _any_ activity or service is
started.
Found when SettingsActivity came back after another (unrelated) NPE.
Fix NPE after preferences change.