mkdirp, but chown to the owner of the containing
folder if possible and necessary.
That is, on Windows and when running as non-root, it's exactly the same as
This is used by npm to prevent root-owned files and
folders from showing up in your home directory (either in
~/.npm cache) when running as root.