Fix some potential power-draining race conditions am: 7510fbbcd0
am: 89fb5a46bb

Change-Id: I4977ead9ea7b83571bfb413f82b2b8f91305060d