Fix segfault when re-loading an EP library (#24539)
### Description
Fixes a segfault that occurs when an EP library is re-loaded in the same
process.
### Motivation and Context
A recent [PR ](https://github.com/microsoft/onnxruntime/pull/24430)
updated the Environment to unload all EP libraries on destruction of
`OrtEnv`. We forgot to properly update the state to mark the EP library
as unloaded. Therefore, this caused a segfault when the EP library was
re-loaded.