(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 don't quite get your point here. You are basically suggesting to separate *invalid regexp error* from IllegalArgumentException and you say that this might help finding error cause later.

But this is really a user's error which we try to validate here. User cannot see exception type, because we just use take message and send it in 4xx response, so it won't really matter which exception type to use. 
But if we use a different exception type than IllegalArgumentException, then we will need to catch it somewhere near to the IllegalArgumentException handler.