Fix for ROOT-5317 + Cleanup

This is the fix for
https://sft.its.cern.ch/jira/browse/ROOT-5317
Now dictionaries, their headers and rootmap files are initially
created as temp files (_tmp suffix) and only at the end of the
rootcling main "committed" (renamed).
This allows to have them on disk in case of crashes and to
avoid that a build continues with an incomplete or bogus
dictionary. This is very dangerous, since that the compilation
may in an unfortunate case progress untill success and strange
runtime behaviours may emerge.

The cleanup refers to some an unnecessary and previously not
always working function, CleanUpOnExit and some general code
cleanups.