preferences: Save prefs when a value is changed

Including test!