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