Workaround for the race condition in the TH1 destructor. Now histograms are always destroyed in a single thread.