Reduce lifetime of lock in TFile::~TFile to avoid lock nesting.

No need to hold the gROOTMutex while executing ResetGlobalVar.