Android: Use apply() instead of commit() for SharedPreference changes.

apply() changes the in-memory instance of SharedPreferences and writes to the disk asynchronously, rather than synchronously, which commit() does. Since these are done on the UI thread, they should be asynchronous.
Merge pull request #1242 from lioncash/sync

Android: Use apply() instead of commit() for SharedPreference changes.