Use the native set_charset() method if available instead of SET NAMES

According to the PHP manual, it is the recommended way to set the charset.

- mysql extension has it for MySQL >= 5.0.7
- mysqli extension has it for MySQL >= 5.0.6
or if using mysqlnd.

Change-Id: I8cd2f97fcad4b045c6f99ff894254847b13c6878
Merge "Use the native set_charset() method if available instead of SET NAMES"