fix initial implementation of task cloning which did not do deep copies, resulting in segfaults
Merge branch 'clone-task' into 3.7.X-badi

* clone-task:
  fix initial implementation of task cloning which did not do deep copies, resulting in segfaults