Save task duration correctly (#4540)
The bug is the `tracer()` updates duration every time you call it, and
we hadn't called it after task execution. I'm adding a new state to get
this timestamp. We cannot use `TargetBuilt` because we don't want to
capture that state until _after_ cache is saved, and, conversely, we
don't want to include the time to save the cache in the task duration.