Check if the mysql_set_charset function exists before attempting to use it.

It doesn't exist in older versions of mysql, fixes #208