Java: release provider option values with the correct strings (#31828)
## Summary
- release CUDA provider option values against the `jstring` objects they
came from
- apply the same correction to the TensorRT provider option binding
Fixes #31706
## Testing
- `git diff --check`
- A JNI/Gradle build could not be run locally because this Windows
environment has no JDK or C compiler. The change is limited to the two
provider-option release loops and is ready for repository CI.
## AI assistance disclosure
I identified and reproduced the issue, then used OpenAI Codex to assist
with the implementation and regression-test work. I personally reviewed
the resulting diff and ran the validation commands listed above to
verify the fix. Any full-suite or local-environment limitations are
documented in the validation section.
---------
Co-authored-by: Scott McKay <skottmckay@gmail.com>