Fix PyMySQL reference error detection
Fix PyMySQL reference error detection

When PyMySQL experiences a constraing error a unicode string prefix is
prepended part way through the inner_exception string. As a result, we
raise a DBError when we should be raising a DBReferenceError.

Change-Id: I5de1333d933bd28ca535852f4643df2ebbc7f964

openstack/oslo.db,magic0704/oslo.db,openstack/oslo.db