CTFE compile: Count total variable declarations

First step towards CTFE compilation. Walk over all
expressions in the function, searching for VarDeclarations and
checking the validity of the AST.
CTFE sanity check: verify no ErrorExps in AST

Before starting CTFE, we confirm that the AST is valid.
Merge pull request #2129 from donc/ctfe_JIT_step1

CTFE JIT compilation, step 1: walk AST, check integrity