[settings] implement OnSettingsUnloaded, fixes various advancedsettings leaking from profile to profile (e.g. mysql database config)