Add deconstructor calls to tasks.

Our stack is not calling deconstructors of its elements. This is problematic for e.g. the graph implementation where reference counted images are hold in tasks. To solve this for now we manually call the deconstructor after each tasks (we do so, because a generic, virtual deconstructor adds runtime costs to primitive tasks, requiring us to re-run all benchmarks; with this change we do not need to do this and as we re-work the scheduler anyways we postpone a clean implementation for then).
4 jobs from master in 4 minutes 57 seconds (queued for 4 seconds)
Status Job ID Name Coverage
  Build
passed #3349
build_cmake

00:46

 
  Test
passed #3350
run_tests

00:53

 
  Sanitizer
passed #3352
run_address_sanitizer

01:59

passed #3351
run_thread_sanitizer

01:17