etcd: fix mode change race