Wrapping and serializing failures

* save task failures to sqlalchemy backend and restore them
  from there;
* for any wrapped exception use common WrappedFailre exception
  type, which makes it easier to handle particular exception types;
* several minor improvements.

Affects-db: this change adds db migration that looses exception
    information for saved task details.
Change-Id: I575282002e6999646bbf51f492b82a7e3525787a
Merge "Wrapping and serializing failures"
Correctly save task versions

When task is added to storage or task detail is saved to persistence
backend, task version should be saved with it.

Change-Id: I43e97cb621c3ffbbc27cafdc206ac39389336a24
Check for duplicate task names on flattening

Task names should be unique within flow. But complete set of tasks
is not generally known until flow flattening is run. So, we check
task names uniqueness as soon as we have execution graph.

Change-Id: I658b3ae606fc79e600d90b51f0b4ed4f4e7d511d