Avoids issues with concurrency. Bug: 17439227 (cherry picked from commit 1ae33d68) Change-Id: I672e83537a12110a77c589697b721b9b26f3c53b