Allow mkdir helper to skip parent errors

Our mkdir helper was failing is a parent directory was not
accessible even if the child directory could be created.
This changes the helper to keep trying child directories
even when the parent is unwritable.
Merge pull request #2531 from libgit2/rb/mkdir-allow-parent-failures

Allow mkdir helper to skip parent errors