Philippe's fix for empty array I/O

The change to TH1::Clone triggered a long standing bug in ROOT I/O when dealing with an empty array. Philippe provided a fix for the problem but only for newer versions of ROOT. This pull includes 
-reverting the reverting of the TH1::Clone change
-Philippe's change
-my patch to Philippe's change to make it v5.34.18 compatible