gossip: fix race condition in gossip_init