Fix: task isn't removed from zk when failure hanppens

Persisting the old taskId but not the new one when handling failed task
causes the problem.