Fixed race conditions in SystemClock and MessageListener tests.