Fix race condition in metrics worker looping function test (the looping call could fire before the explicit call to the looping function, cause two sets of command messages to be sent). (@jerith).