Avoid segmentation fault when creating session with TRT EP or OpenVINO EP using python (#9814)
Avoid segmentation fault when creating session with TRT EP or OpenVINO EP using python (#9814)

* fix segmentation fault

* fix typo

* fix bug

* make logic the same as CUDA ep

* Modify for OpenVINO

* Add env variable check for OpenVIO

* refine the code

* refine EP failed registration warning messages.

* update OpenVINO exception message.

Co-authored-by: George Wu <f54f469f787fdb4486d5e85a252895778442416b@microsoft.com>
microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime,microsoft/onnxruntime