Remove results before a task

Results should be removed before a task into a transaction otherwise the
deletion doesn't happen with error because Foreign Constraint
verification failed.

Closes-Bug: #1269866

Change-Id: I2cf2087ea5f9badba6540a5a5430650a30d51162