(PDB-950) Added validation for regexps in queries

This commit adds a validation for regexps in queries as was proposed in PDB-950
> If I understood you correctly, you suggests to leave this check for both DB, but don't fail PG request immediately and rather perform a query. Then if we see that query failed - generate a 4xx error (we already know that this is because of invalid regexp).

Almost ... put in the check and if it fails just fail for both regardless, ie. disregard my concern for now. Return a 400 early. We'll then do some research and testing on this end, to see where it might not be quite 'perfect'.

Now as obviously Java regexp is a superset most probably of some POSIX re features, that check isn't enough for PG, so we need to also do a validation at query runtime as we described. Somehow we need to identify if its just a regexp query or some other fatal PSQLException, that might be tricky but worth the research into status codes and error codes and such (matching the error string would be the very last thing I'd try, since thats not the most stable of API's).

I can talk on skype if you like ... kenbarber_geek ... I'm about to go to lunch soon but send me a request and we can chat later on. I'm in the UK.