Fix Gather to Split optimizer (#14478)
### Description
Gather to Split optimizer fails if opset == 18. This PR fixes one bug
and extend unit tests.
### Motivation and Context
The model produced by the optimizer does not follow onnx specifications
with opset 18.