I got an unexpected internal NPE when playing with this script.

```
POST _scripts/painless/_execute
{
  "script": {
    "source": """
    return /[^\w]+/.split('abc   def higkln').toArray(String[]::new)
    """
  }
}
```
```
{
  "error" : {
    "root_cause" : [
      {
        "type" : "script_exception",
        "reason" : "compile error",
        "script_stack" : [ ],
        "script" : "\n    return /[^\\w]+/.split('abc   def higkln').toArray(String[]::new)\n    ",
        "lang" : "painless"
      }
    ],
    "type" : "script_exception",
    "reason" : "compile error",
    "script_stack" : [ ],
    "script" : "\n    return /[^\\w]+/.split('abc   def higkln').toArray(String[]::new)\n    ",
    "lang" : "painless",
    "caused_by" : {
      "type" : "null_pointer_exception",
      "reason" : "Cannot read field \"annotations\" because the return value of \"org.elasticsearch.painless.lookup.PainlessLookup.lookupPainlessClass(java.lang.Class)\" is null"
    }
  },
  "status" : 400
}

```
modules/lang-painless/src/test/java/org/elasticsearch/painless/WhenThingsGoWrongTests.java
/*
 * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
 * or more contributor license agreements. Licensed under the Elastic License
 * 2.0 and the Server Side Public License, v 1; you may not use this file except
 * in compliance with, at your election, the Elastic License 2.0 or the Server
 * Side Public License, v 1.
 */
package org.elasticsearch.painless;
import junit.framework.AssertionFailedError;
import org.apache.lucene.util.Constants;
import org.elasticsearch.script.ScriptException;
import java.lang.invoke.WrongMethodTypeException;
import java.util.Collections;
import java.util.Map;
import java.util.function.Supplier;
import static java.util.Collections.emptyMap;
import static java.util.Collections.singletonMap;
import static org.hamcrest.Matchers.instanceOf;
public class WhenThingsGoWrongTests extends ScriptTestCase {
    public void testNullPointer() {
        expectScriptThrows(NullPointerException.class, () -> { exec("int x = params['missing']; return x;"); });
        expectScriptThrows(NullPointerException.class, () -> { exec("Double.parseDouble(params['missing'])"); });
    }
    public void testDefNullPointer() {
        NullPointerException npe = expectScriptThrows(
            NullPointerException.class,