Use ping first to check connection status for mysql_adapter

MySQL's stat is a very resource hungry method. Replacing it with ping lowers the CPU utilization by a good factor on large Ruby on Rails deployments.