Check gROOT->IsBatch only once - avoid switching between TUnixSystem/TMacOSXSystem DispatchOneEvent,

if it's started with -b, it's a batch mode.
Merge branch 'v5-34-00-patches' of https://root.cern.ch/git/root into v5-34-00-patches