remove directory mode check from makedirs (closes #21082)
merge 3.2 (#21082)