bpo-42246: Fix memory leak in compiler (GH-23256)

* Fix potential memory leak in assembler init.

* Fix reference leak when encountering error during compilation of function body.
1 file changed