[Chapel Merge] CG: Fix memory leaks with strings

Branch: refs/heads/master
Revision: a3a7beb
Author: vasslitvinov
Log Message:

Merge pull request #17348 from vasslitvinov/fix-CG-memleak

CG: Fix memory leaks with strings

This fixes memory leaks arising when CG functions pass around the values
of interface types and get instantiated with strings.

The fix is to ensure that FLAG_INSERT_AUTO_DESTROY is added on CG
variables when it would be for a record.

I did not add any new tests because the previously-leaked tests
are here to stay:


We have discussed making CG types behave like records w.r.t. memory
management throughout resolution. This remains outside the scope
of this PR.

r: @e-kayrakli

Modified Files:
M compiler/resolution/postFold.cpp

Compare: https://github.com/chapel-lang/chapel/compare/63449c9010cd...a3a7beb08424