fix heap pointer reset when exiting loops
fix heap pointer reset when exiting loops

this is a terrible hack (like this entire project right now) but should be easy
to refactor into the struct and share it there.

threads should always copy the current heap pointer but never share it with the
parent thread.

neilvallon/sansan