[service_discovery][etcd] Use a correct index to determine last update
[service_discovery][etcd] Use a correct index to determine last update

The `res.etcd_index` value that was previously used is the
`X-Etcd-Index` header of etcd's http response.

According to etcd's docs this index is the current index of the whole
cluster, so any modification on any key increments this value.

Using it as a reference to determine if the datastore has changed
would trigger a config reload on every modification in the datastore
(whereas we want a config reload only when the `sd_template_dir`
changes).

To fix this, we parse the `modifiedIndex` of all the returned keys
instead, and we take the max index as the correct index.

cberry777/dd-agent,jyogi/purvar-agent,Wattpad/dd-agent,manolama/dd-agent,Wattpad/dd-agent,takus/dd-agent,cberry777/dd-agent,takus/dd-agent,takus/dd-agent,takus/dd-agent,cberry777/dd-agent,manolama/dd-agent,takus/dd-agent,Wattpad/dd-agent,jyogi/purvar-agent,jyogi/purvar-agent,manolama/dd-agent,jyogi/purvar-agent,manolama/dd-agent,manolama/dd-agent,Wattpad/dd-agent,cberry777/dd-agent,cberry777/dd-agent,Wattpad/dd-agent,jyogi/purvar-agent