metrics-core: Fix race condition in InstrumentedThreadFactoryTest.

Test randomly fails for me in Java 1.7.0_45-b18

This locks all the critical sections around the meter changes and asserts that they happen in an orderly fashion (as far as I can tell).

I would probably recommend dropping this unit test and try to figure out how to re-factor InstrumentedThreadFactory to not depend on a real thread pool.