Retry failed tasks

This does not yet make sure tasks are not retried on the same agent they
just failed on.
Merge pull request #128 from guidow/retry_failed_tasks

Retry failed tasks