Deadlock retries

Retry transaction on deadlock error.
From a purely code style standpoint, do you think this would be more or less readable/maintainable:

```ruby
rescue ActiveRecord::StatementInvalid => error
  # Only retry the block above if the error is a deadlock and we haven't 
  # already retried this block max_retries times.
  raise unless error.message =~ /Deadlock found when trying to get lock/ and retry_count < max_retries
  retry_count += 1
  logger.info "Retry ##{retry_count} after deadlock: #{error.inspect}"
  retry
end
```

I like it because the `raise` exit point is consolidated to a single line, and that line follows the flow as described by the comment a bit more closely. I'm not sure how you feel about compound suffix conditionals.

Additionally, is that error message check sufficiently hardened? Is there any sort of specific error code that could be checked instead that might be more reliable? I'm not sure if that's a realistic concern.