HDFS-6981. Fix DN upgrade with layout version change. (Arpit Agarwal)