lib/etcd: make etcdstore generic