Set factory on all tests that use PreferencesExt.

This should ensure tests don't sporadically fail.