[FIX] project.task: simplify delegated tasks remapping after task copy + avoid write() call if not necessary

This avoids recomputing function fields if not
necessary.
[FIX] project.copy(): avoid preparing useless children data to copy, as they are discared in analytic.copy. Duplicating children is handled by  duplicate_template().
[FIX] mail.thread: avoid tracking multiple temporary changes during copy