fix bug in mkdirp when parent exists and there are paths left to create