Introduce a method to set any MySQL session SQL mode

Rather than implement a method just for the special case of setting
MySQL TRADITIONAL mode, implement one that can set any supported
server mode, and reimplement the old method as a wrapper around that.

In addition, check the actual effective SQL mode
(as per SHOW VARIABLES LIKE 'sql_mode'), and log a warning if it's
deemed unsafe.

Co-author: Ben Nemec <openstack@nemebean.com>

Change-Id: I90139b915b2ff169878fd93625e5320d39094ed3
Introduce mysql_sql_mode option, remove old warning

Introduce a config option, mysql_sql_mode, that allows the user
to set the desired SQL mode for MySQL sessions.

For MySQL sessions, set the SQL mode session variable
accordingly.

For compatibility purposes, retain the mysql_traditional_mode
argument in method signatures, but only use it to override the
config option as if it were set to 'TRADITIONAL'.

Change-Id: Ia527e850671ab9542db5864617384cee21e91bf6
Closes-bug: 1271706