[Chapel Merge] Avoid memory leak in ArgumentParser

Branch: refs/heads/main
Revision: 937aee5
Author: mppf
Log Message:

Merge pull request #18392 from mppf/avoid-leak-argparse

Avoid memory leak in ArgumentParser

This is a workaround for issue #18391. It avoids a memory leak that we observed in nightly testing, e.g. with

test/library/packages/ArgumentParser/ArgumentParserExample.chpl

Reviewed by @arezaii - thanks!