codegen, toplevel: s/alloca/malloc/ in two calls

The pointer obtained from alloca should not outlive the stack frame. We
should use malloc for boxing return values.