[Chapel Merge] Fix dangling reference bug.

Branch: refs/heads/main
Revision: d55936dbd359979345292f65621f47eb91cdc128
Author: Danila Fedorin
Link: Fix dangling reference bug. by DanilaFe · Pull Request #21055 · chapel-lang/chapel · GitHub
Log Message:

Fix dangling reference bug.
Sometimes, a UniqueString struct contains the c_str() it represents (small string optimization), which means it needs to stay in scope for the c_str() to remain valid. This temporary goes out of scope right away, so the c_str() may be invalid. Testing: - ASAN failures before this are fixed after this. - full local testing Reviewed by @dlongnecke-cray - thanks! Signed-off-by: Danila Fedorin