Disable MigrationPreferenceInitializer in UI less environment

This commit prevents possible exceptions that are thrown in an UI less
environment like the test suite because this component relies on UI
classes.