brainfunc: fix memory leaks.

The interpreter leaked memory in 3 places when running the
sample 'hello' program. This patch fixes the leaks.