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

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).
Instead of iterating here, we should just not bother if the db is not hsqldb. That is, I think your methodology is falling through on a case that is unnecessary. If you just kept the check here and below, and then only iterate+validate specifically for hsqldb this code could be kept reasonably small here. That would also drop the need for a mutlimethod. Just have something like:

```
(when (= "HSQLDB Database Engine" (sql-current_connection-database-name))
  (doseq [regexp regexp-vec]
    (validate-hsqldb-regexp regexp)))
```

It also moves the throw into the validate-hsqldb-regexp function (or whatever its called) as well and moves it closer to the check, keeping this part of the code smaller.