HDFS-4249: correct handling of counters for safemode