Workaround for SwitchPreference bug in Android

Android's SwitchPreference has a serious bug that causes its state to
be (sometimes) reset when the view is scrolled off screen. Included is
a workaround submitted by Joe on Stack Overflow.

This bug is in all versions of Android in which SwitchPreference is
avaiable including the latest 4.4.4. It's unclear if this will be fixed
in Android 5 Lollipop but it is fixed in Google's latest master branch.

Stack Overflow: http://stackoverflow.com/a/15744076/238374
Android: https://code.google.com/p/android/issues/detail?id=26194