Fixes LeakSanitizer failure from #206161 (reverted in #207104); `mlirFreezeRewritePattern` moves contents out of the `RewritePatternSet` but does not free the container (passed by value in the C API), so the allocation from `mlirRewritePatternSetCreate` was never freed (add `mlirRewritePatternSetDestroy(patterns)` after freezing).