fix nasty little bug in Module.ccall

In our code, we were entering C from JS using ccall, then inside the C calling back out to JS, which in turn re-entered the C code using ccall. Due to the use of the global in ccall, this can badly corrupt the stack, but usually nothing crashes. For weeks we hadn't tracked down the cause (SAFE_HEAP doesn't help here)!

Basically, the `stack` global here is just evil. In the case of nested calls, the inner ccall resets the stack on exit to the value stashed by the outer ccall. Even worse, ccall actually fails if called twice with different base stack values, because `stack` is not reset to zero anywhere in this code, so no matter how many times you use ccall, `stackSave` is only used in the first one.

Just use a local variable.

I've added a test which comprehensively crashes without the fix applied to preamble.js.