Rework battery saver synchronization logic

- Stop using individual lock instances and use use the power manager lock.
- Make sure not to access external components with the lock held,
*except for settings provider*, which is already touched by the power manager
and the battery service

(I'm planning to re-organize things for Q: b/79580230)

Fixes: 79486713

Test: atest /android/pi-dev/frameworks/base/services/tests/servicestests/src/com/android/server/power/batterysaver/Battery*Test.java /android/pi-dev/frameworks/base/services/tests/servicestests/src/com/android/server/power/*Test.java
Test: Manual test with ./development/scripts/battery_simulator.py with toggling
battery saver on and off and then watch
adb logcat -b all | grep -P '(battery_saving_stats|battery_saver_mode)'

Change-Id: I8ecdfefe978de348ee979d765c82e3d8f0280082
9 files changed