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/main/java/org/elasticsearch/painless/phase/DefaultSemanticAnalysisPhase.java
@Override
    public void visitBlock(SBlock userBlockNode, SemanticScope semanticScope) {
        List<AStatement> userStatementNodes = userBlockNode.getStatementNodes();
        if (userStatementNodes.isEmpty()) {
            throw userBlockNode.createError(new IllegalArgumentException("invalid block: found no statements"));
        }
        AStatement lastUserStatement = userStatementNodes.get(userStatementNodes.size() - 1);
        boolean lastSource = semanticScope.getCondition(userBlockNode, LastSource.class);
        boolean beginLoop = semanticScope.getCondition(userBlockNode, BeginLoop.class);
        boolean inLoop = semanticScope.getCondition(userBlockNode, InLoop.class);
        boolean lastLoop = semanticScope.getCondition(userBlockNode, LastLoop.class);
        boolean allEscape;
        boolean anyContinue = false;
        boolean anyBreak = false;
        for (AStatement userStatementNode : userStatementNodes) {
            if (inLoop) {
                semanticScope.setCondition(userStatementNode, InLoop.class);
            }
            if (userStatementNode == lastUserStatement) {
                if (beginLoop || lastLoop) {
                    semanticScope.setCondition(userStatementNode, LastLoop.class);
                }
                if (lastSource) {
                    semanticScope.setCondition(userStatementNode, LastSource.class);
                }
            }
            visit(userStatementNode, semanticScope);
            allEscape = semanticScope.getCondition(userStatementNode, AllEscape.class);
            if (userStatementNode == lastUserStatement) {
                semanticScope.replicateCondition(userStatementNode, userBlockNode, MethodEscape.class);