Improve deadlock detection, fix for Rails 4.1

The broader regular expression should also retry
deadlocks in Postgres, SQL Server and possibly others too.
Merge pull request #254 from agios/deadlock_detection

Improve deadlock detection, fix for Rails 4.1