LUCENE-6920: Improve custom function checks in expressions module to use MethodHandles and work without extra security privileges