Fix modification of threadprivate(Task) outside of parallel environment