Bugfix: Wrong order of args in isinstance
Change chdir to path for reactor.spawnProcess

reactor.spawnProcess expects a kwarg "path", not "chdir"
Change WorkState.ERROR to WorkState.FAILED

WorkState.ERROR is not defined in the WorkState enum
Split process_stopped into public/private methods

There is now _process_stopped, which is directly called from the
ProcessProtocol, and process_stopped, which is called from
_process_stopped and can be overriden by the jobtype implementor.
Track whether at least 1 process in a batch failed
Mark all tasks as done/failed after last process

When the last process in an assignment exits, mark all tasks in this
assignment as done if none of the child processes have failed, or failed
if at least one child process has failed
Actually upload changed agent states to the master
Honor delay when postin state update
Bugfix: Use random, not Agent.http_retry_delay

Agent.http_retry_delay is not available and trying to import it leads to
a circular import
Retry setting state on 5xx return code
Fixed TODO line
Merge pull request #36 from guidow/update_task_status

Update task status