Factor out running callbacks in the worker.

We can factor out all callbacks apart from the run-failed callback as we have to
treat that one separately in case of failure within the failure handler.