Per #390 use LIBMYSQL_VERSION where available

Fixes problems linking against mysql-connector-c library.