``end_of_math()`` fallbacks

I’ve added those fallbacks (courtesy of HH) for ``node.end_of_math()`` to both lua files.