Use enable_tracing flag for ProxyTorchDispatchMode instead of modifying torch dispatch mode stack inner attributes (#82643)
### Description
This PR removes fiddling with the mode stack using copies and ExitStack in favor of a simpler and more straightforward approach.
### Issue
https://github.com/pytorch/pytorch/pull/81764#discussion_r934917799
### Testing
No new tests are needed.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/82643
Approved by: https://github.com/ezyang