Fix SharedPreferences.apply API level <9 incompatibility