Unittests: Mitigate race condition in unittest.