Fixed race condition in gossip callbacks test.