Fix execution state ERROR if task_spec has on-finish

 * We shouldn't set execution state in ERROR if
   task has on-error or on-finish property
 * Fix wait_success method in functional tests

Change-Id: I48e452d5974dd854eb14dcaf23d13e81107a03dc
Merge "Fix execution state ERROR if task_spec has on-finish"