Add PreferencesFormPreSave hook

Allows extensions to modify what preferences will be saved

Change-Id: Ibd8331c39afdde39b688d78f3faade2883f0c997
Merge "Add PreferencesFormPreSave hook"