Simplify and fix MkdirAll usage Upstream-commit: 8d2739df980a1af76ad50e5c423134815186b61c Component: engine