Fix double stop hang on run-on-battery disable

This resolves the issue where if the device is on battery, run on battery
is set to true, the app is in the process of stopping, and the user
disables run on battery, the app will hang in the stopping state
indefinitely.