Correct an infinite loop when calling mkpath on absolute path