Fix Bug: Step failed but not exited with error (#17442)
### Description
Add "set -ex" in the script.
### Motivation and Context
Build failed but it still passed.
https://dev.azure.com/onnxruntime/onnxruntime/_build/results?buildId=1132003&view=logs&j=7536d2cd-87d4-54fe-4891-bfbbf2741d83&t=39e3f98f-7fe5-578c-20bd-5ae5a4590bda