Input validation:
- client_addr not longer than INET6_ADDRSTRLEN
- % allowed only at the end of client_addr
Query rule itself remembers if there is a wildcard or not.
If there is a wildcard compares string till the wildcard.
If client_addr=='%' , it is a match all.
Without this building failed with undefined references to libssh2:
```
g++ -o proxysql obj/main.o obj/proxysql_global.o ../lib/libproxysql.a -std=c++11 -I../include -I../deps/jemalloc/jemalloc/include/jemalloc -I../deps/mariadb-client-library/mariadb_client/include -I../deps/libconfig/libconfig-1.4.9/lib -I../deps/libdaemon/libdaemon -I../deps/sqlite3/sqlite3 -I../deps/clickhouse-cpp/clickhouse-cpp -I../deps/libmicrohttpd/libmicrohttpd/src/include -I../deps/curl/curl//include -O2 -ggdb -L../lib -L../deps/jemalloc/jemalloc/lib -L../deps/libconfig/libconfig-1.4.9/lib/.libs -L../deps/re2/re2/obj -L../deps/mariadb-client-library/mariadb_client/libmariadb -L../deps/libdaemon/libdaemon/libdaemon/.libs -L../deps/pcre/pcre/.libs -L../deps/libmicrohttpd/libmicrohttpd/src/microhttpd/.libs -L../deps/curl/curl//lib/.libs -Wl,--export-dynamic -Wl,-Bstatic -lconfig -lproxysql -ldaemon -ljemalloc -lconfig++ -lre2 -lpcrecpp -lpcre -lmariadbclient -lmicrohttpd -lcurl -Wl,-Bdynamic -lpthread -lm -lz -lrt -lcrypto -lssl -ldl
../deps/curl/curl//lib/.libs/libcurl.a(libcurl_la-easy.o): In function `global_init':
easy.c:(.text+0x7d): undefined reference to `libssh2_init'
../deps/curl/curl//lib/.libs/libcurl.a(libcurl_la-easy.o): In function `curl_global_cleanup':
easy.c:(.text+0x2c8): undefined reference to `libssh2_exit'
```
I don't think libssh2 support is needed and this fixes the build.
The other option would be to add `-lssh2`.
The fix for bug #1038 was to not return a connection to the connection pool if it has an error.
Although this is correct, it also has the side effect that connections coming
from connection pool and failing during the first query because the connection
was already broken, would be considered as possibly to run a transaction.
That is incorrect.
Now at connection level it is tracked if the transaction status is known or not.
* is STMT_PREPARE failed when there is a previous status (maybe STMT_EXECUTE) disconnect the client immediately. Maybe this is related to #1366 , but I can't reproduce it yet
* purge prepared statements is also their server reference counter is 0
* initialize connections queue for purging connections
This commit also prevents shunned nodes to come back online if they are missing pings. Related to #1416
Because it reduces the number of checks, it may also be relevant to #1417