[#9] regmatch^%ydbposix should free its memory rather than relying on the user to do it
This issue was exposed when running Valgrind on Octo, which uses regmatch^%ydbposix. The following was found:
- M users do not expect to free memory. So the developers and reviewers never thought of needing to call regfree.
- regfree is pretty difficult to use, requiring knowledge of the internal mechanics of how regmatch constructs the subscripts for a variable.
This commit makes regmatch free its own memory.
Running valgrind with Octo reveals no memory leaks now after all the frees were backtracked from the Octo code base.