check_mysql_query: perfdata + smarter output

Just turning attached patch of github issue #996 into a push request.