etcdserver: fix race and improve stats interfaces