mkpath: much simpler recursive implementation.