Don't recursively expand undefined macros

This led to infinite recursion when compiling a macro which inside used an
undefined macro. Instead some dummy expression is returned for the result of
expansion (rather than the macro itself).

Closes #11692