Improve deadlock detection, fix for Rails 4.1

The broader regular expression should also retry
deadlocks in Postgres, SQL Server and possibly others too.