Wait for mkdirp to finish before returning. #287

Minor fix; we need to wait for mkdirp to finish before returning success, otherwise it will always return success (and in the case of failure the failure will just make the whole thing crash since we've already returned)