Task - fix setTaskFlowType to avoid deadlocks