LoginUtils.saveAuthToPreferences(): Really avoid the crash.

There was a null dereference crash when using old preferences,
when we then tried to wipe them out with nulls.
Also moved the get*Pref() methods to Utils so we can use them
as public methods in some more LoginUtils tests.