(PDB-950) Added validation for regexps in queries in API v4

This comes from [PR-1142](https://github.com/puppetlabs/puppetdb/pull/1142) to simplify merge/discussion.

This PR adds a simple validation for regexps in queries in all APIs v4.
It validates regexps using Java rules, so there might be some constructions that pass this validation but won't be valid in Postgres.
Here is an example of such construction:
curl -v 'http://localhost:8080/v4/fact-contents?query=\["~","name","\\p\{Alnum\}"\]'

Those regexp differences are discussed in original [PR-1142](https://github.com/puppetlabs/puppetdb/pull/1142).
I'm suggesting to incorporate the message from the PatternSyntaxException in the IllegalArgumentException that is thrown, on the presumption that that is shown to the user. I'm not suggesting throwing a PatternSyntaxException, but throwing something like 
```clj
(IllegalArgumentException. (format "invalid syntax in regular expression '%s'. The problem is %s" regexp (.getMessage e)))
```
 where `e` is the PatternSyntaxException thrown by `(re-pattern regexp)`.

In order to do that, I suggest replacing `valid-regexp?` with something like
```clj
(defn regexp-syntax-exception
  [regexp]
  (try
    (re-pattern regexp)
    nil
    (catch java.util.regex.PatternSyntaxException e
      e)))
```
and then testing for an invalid regexp with
```
(when-let [syntax-exc (regexp-syntax-exception regex)]
  ...)
```

The goal of this is to put the explanation of the error from the PatternSyntaxException's message in the message of the IllegalArgumentException whose message is eventually shown to the user, since that will point the problem out to the user instead of making them find it.

Does that make sense?