Merge "Prevent WakeLock count ending up in an incorrect state"