Fix the typing of the Tasks in ForkJoin.h
What does this implement/fix?
When a custom thread environment is used in ForkJoin.h, the tasks generated in ParallelFor are not the environment-specific task, leading to a type error. This MR fixes that.