subroutine to cancel Gearman jobs