Ctfe internal fixes

This is part of my major project to unify optimize(WANTinterpret) and CTFE.

Fixes some bugs inside the code, which have no user-visible impact.
Two of the commits are to prevent segfaults when an ICE occurs. They make debugging easier.
The more important commit:
"CTFE: Don't save local variables in the global constants list"
fixes a simple logic bug.