raft: fix a potential race on wait initialization and usage for configuration changes
raft: fix a potential race on wait initialization and usage for configuration changes

Signed-off-by: Alexandre Beslic <7f00c88b7660208d6ae438e5aa377b1c70b9009e@gmail.com>

yp-engineering/swarmkit,jlhawn/swarmkit,allencloud/swarmkit,sungwonh/swarmkit,runshenzhu/swarmkit,vasil-yordanov/swarmkit,deljuven/swarmkit,Noyan759/swarmkit,diogomonica/swarmkit,dperny/swarmkit-1,fate-grand-order/swarmkit,aaronlehmann/swarmkit,docker/swarmkit,diogomonica/swarmkit,sungwonh/swarmkit,vasil-yordanov/swarmkit,RenaudWasTaken/swarmkit,cezarsa/swarmkit,AliyunContainerService/swarmkit,Noyan759/swarmkit,AliyunContainerService/swarmkit,yp-engineering/swarmkit,aaronlehmann/swarmkit,cheyang/swarmkit,alyyousuf7/swarmkit,elifa/swarmkit,dperny/swarmkit-1,jlhawn/swarmkit,alyyousuf7/swarmkit,cheyang/swarmkit,cezarsa/swarmkit,elifa/swarmkit,deljuven/swarmkit,yongtang/swarmkit,docker/swarmkit,fate-grand-order/swarmkit,allencloud/swarmkit,runshenzhu/swarmkit,yongtang/swarmkit,RenaudWasTaken/swarmkit