Eliminate duplicate `_id`s in `PipelineTask`s.

Add a new function, `WorkflowTask.finish` that patches up
tasks. Currently it only finds cases where we can end up with duplicate
ids and eliminates them.

Fixes #327.