Null pointer exception in constant folding of grappler.
### Issue type

Bug

### Have you reproduced the bug with TensorFlow Nightly?

Yes

### Source

source

### TensorFlow version

tf 2.13.0

### Custom code

Yes

### OS platform and distribution

_No response_

### Mobile device

_No response_

### Python version

_No response_

### Bazel version

_No response_

### GCC/compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current behavior?

Segmentation fault.


### Standalone code to reproduce the issue


[NPE.zip](https://github.com/tensorflow/tensorflow/files/12444694/NPE.zip)

Run the poc.py in the zip.
In constant folding, after `FoldNode`, fold nodes will be updated with the new name at 【1】. But later, the old node name will still be referenced in `MergeConcat` (【2】) with `GetNode`(【3】), leading to an NPE.



```C++
//tensorflow/core/grappler/optimizers/constant_folding.cc
Status ConstantFolding::FoldNode(NodeDef* node, GraphDef* output_graph,
                                 bool* result_too_large) {
    ...
    else if (port < static_cast<int>(const_nodes.size()) &&
               !const_nodes[port].name().empty()) {
          //【1】
          node_map_->UpdateInput(output->name(), NodeName(output->input(i)),
                                   const_nodes[port].name());
          *output->mutable_input(i) = const_nodes[port].name();
 } 

bool ConstantFolding::MergeConcat(bool use_shape_info,
                                  GraphProperties* properties,
                                  GraphDef* optimized_graph, NodeDef* node) {
   ……
   for (int i = 0; i < num_regular_inputs - 1; ++i) {
       //【2】
       const NodeDef* input_node = node_map_->GetNode(node->input(i));
       if (!IsReallyConstant(*input_node)) {……}
}

//tensorflow/core/grappler/utils.h
NodeDefT* GetNode(const string& name) const {
    const string node_name = NodeName(name);
    auto it = nodes_.find(node_name);
    if (it == nodes_.end()) {
      VLOG(1) << "Node could not be found: " << name;
      return nullptr; //【3】
    }
    return it->second;
 }
```


### Relevant log output

_No response_