wait_for_tasks should not change given list