Fix thread safety issue on clearing cache

Historically, we havent held a lock on ForceClearCache and
ClearCacheIfNecessary. This is not thread safe because kAllPullAtomInfo
must be accessed in a lock, especially now that pullers can be
registered/unregistered.

Test: atest statsd_test, wrote a repro cl.
Bug: 168156854
Change-Id: I47d53a6d9d274bca4c78dbfd87e0097091b7b8cb
Merged-In: I47d53a6d9d274bca4c78dbfd87e0097091b7b8cb
(cherry picked from commit 7a4a1a5fe2b3f0239fe7f84662d41586ee8be61d)
1 file changed
tree: f54c2cf73ba137af8ab955a3786dbef48e31d755
  1. bin/