etcd: refactor waitCluster