Make MySQL regexes generic across MySQL drivers

Note that mysqlconnector raises InternalError whereas mysqldb raises
OperationalError when a deadlock is found.  The reported error codes and
messages are identical, however.

Change-Id: Iac9167e0777e0bf4361bcf6a8722923cce052b90