[metrics] Make metrics atomic am: c4adf54117

Original change: https://android-review.googlesource.com/c/platform/art/+/1446999

Change-Id: I1b5f488f54f83ee92ad131d86774733259f5c8c9