Mysql: Improved library detection.
MariaDB is often installed without the mariadb client library
(but with the mysql client library), so search for the mysql
client library if the mariadb client library can't be found.
Also adds searching for reentrant versions of the client libraries.
Fixes compilation issues on machines with MariaDB server but
not MariaDB client.