Merge "Fix potential race condition."
am: 61fc364601

Change-Id: I5f1d1748b53bd909800d72a91423686cb9a7a2e9