Close the file before starting to free TFile's resources
Change order of preproc defines and undefines

Anticipate the undefines.
Suppose to have a namespace called "declarations" used in R5 for template
instantiations in the header given to genreflex.
Now, in this namespace, objects with some names, typically dummy, will be
present.
If you give such headers to cling to parse, problems will occour, as the
names appear multiple times. One possible solution is to get out of this
with preprocessor defines given to genreflex, redefining "declarations"
to a hash or <project>_<package> via the build system.
Fix math core fit tests