Fix mixin("switch") and mixin("interface;") segfault.

CompileStatement::flatten needs to check for errors before adding
statement to AST.

Similarly with CompileDeclaration::compileIt.