(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).
It may be better to replace this with a `regexp-exception` function that returns a PatternSyntaxException if the regexp is malformed, and nil otherwise. Then validate-binary-operators could use regexp-exception in an if-let that binds the exception in order to stick the syntax exception's message in the IllegalArgumentException that validate-binary-operators throws, which will tell the user *why* the regexp is invalid. That'll help them fix the problem faster than just saying it's invalid and relying on them to catch the mistake.