Reduce the chance of BatteryStats background work affecting CTS tests

Add some utility methods to help get consistent behavior from
batterystats

Fixes: 185970842
Test: atest
android.cts.statsd.validation.ValidationTests#testPartialWakelock
--rerun-until-failure

Change-Id: I773a4afb91822103a8a666b575f128d776bed5ec
2 files changed