Fix completed tasks metrics

The completed tasks metrics was misbehaving when
retrying replication tasks, because the reschedule
was adding the metric task wrapper multiple times.

Check for double-wrapping and avoid duplications.

Change-Id: Ib7a87c667fba8a8ef0d6bb05b8a50303c2d37139
2 files changed