HDFS-7462. Consolidate implementation of mkdirs() into a single class. Contributed by Haohui Mai.