[TAV-355] Handle a busy Taverna Server.

The worker will now back off and retry a run if the server says it is already
running as many runs as it can cope with at once.
Worker code blocks refactor.

Move code that uses the run variable out of a block so we can more carefully
instansiate that variable in the first place.
[TAV-355] Handle a full Taverna Server.

The worker will now back off and retry a run if the server says it already has
as many runs as it can cope with initialized at once.
Check for delayed_job in a run before using it!

This was occasionally breaking cancel when a run had a delayed job id, but the
job itself had been cleaned up.