Merge "metricsd: Fix race condition in the tests."