Lock access to global functions list

TFormula indirectly accesses gROOT->fGlobalFunctions. Therefore to safely call different TFormula on different threads, access to the global function list must be serialized.