Fix memory leaks in the VM.
Fix memory leaks in the VM.

* Loading more of instructions now cause the old state to be freed
* Move the temporary buffer into the vm struct to avoid future leaks

nahiluhmot/yabfi,nahiluhmot/yabfi