Cancel tasks recursively