consul: fix obscure bug when launching goroutines from for loop