Capture task duration

Record how long a task took to execute (or fail)
by adding a new listener (and associated refactoring)
that can be used to record these time statistics in
storage.

blueprint capture-task-duration

Change-Id: I9c556e5dcbad924380ae4b94ffb03bc22edad50a
Use update_task_metadata in set_task_progress

Instead of duplicating logic done for updating
or creating a task details metadata property we
can just use the new update_task_metadata as
the single function that can do this.

Change-Id: I66041a157b3f37ca083f8e743ec348ca8feacac6
Merge "Capture task duration"
Merge "Use update_task_metadata in set_task_progress"