[VitisAI] fix throw on dfs (#23678)
### Description
<!-- Describe your changes. -->
Add customized version for reverse dfs which can exit early if the graph
is altered.
### Motivation and Context
<!-- - Why is this change required? What problem does it solve?
- If it fixes an open issue, please link to the issue here. -->
This is requested by MSFT. We used to use throw exception to exit
reverse dfs and this is not preferred by MSFT.
Co-authored-by: Yueqing Zhang <yueqingz@amd.com>