Fix some potential power-draining race conditions

Fixed some race conditions around wakelock and sensor control, which
if hit, would have left a sensor enabled when thought to be disabled
or possibly released a wakelock it didn't intend to release.

Bug: 30262052
Change-Id: Ieae26b2a2a7731ad299cd2c2426676295ffa768e
1 file changed