compiler: Fix a memory leak

Commit 3c982bc563dcb3a9aacf3b5ce9b6d83040f63424 introduced a memory
leak, as now the MemoryVectorNode is not always added as a child
node of the EmitNode. The memory reclaim must be done manually in
this case.