Fail job if number of tasks failed exceeds threshold