Filter out current task when counting active tasks

We are sometimes experiencing problems with jobs not getting set to
failed or done after their last task stops running.  This is an attempt
to address that problem.