Wrap up requeue and remove failed job in a transaction for safety

The previous logic could allow a job to be removed before it was requeued. In the event that something went wrong in the interval, the job could be completely lost. For safety this should be wrapped up in a [Redis transaction](http://redis.io/topics/transactions) to make sure either it is requeued AND removed, or neither.  This pull request makes those changes.

Note that the logic is also reversed so that it reads more clearly (i.e. the `clear_after_requeue` block actually happens after requeue in the code).