Do not write if apply() did not change the file.

Bug: 33385963
Test: SharedPreferences CTS tests
Change-Id: I39955f8fbcdaa54faa539a3c503e12cb00808136
(cherry picked from commit 1f99f81bdc5e8430717def157f4abe1176d6a88e)
1 file changed