Constrain mkdir calls to avoid extra mkdirs

This updates the calls that make the subdirectories for objects
to use a base directory above which git_futils_mkdir won't walk
any higher.  This prevents attempts to mkdir all the way up to
the root of the filesystem.

Also, this moves the objects_dir into the loose backend structure
and removes the separate allocation, plus does some preformatting
of the objects_dir value to guarantee a trailing slash, etc.
Add O_CLOEXEC to open calls
Fixed most documentation header bugs

Fixed a few header @param and @return typos with the help of -Wdocumentation in Xcode.

The following warnings have not been fixed:
common.h:213 - Not sure how the documentation format is for '...'
notes.h:102 - Correct @param name but empty text
notes.h:111 - Correct @param name but empty text
pack.h:140 - @return missing text
pack.h:148 - @return missing text
Work around reparse point stat issues

In theory, p_stat should never return an S_ISLNK result, but due
to the current implementation on Windows with mount points it is
possible that it will.  For now, work around that by allowing a
link in the path to a directory being created.  If it is really a
problem, then the issue will be caught on the next iteration of
the loop, but typically this will be the right thing to do.
Merge pull request #1669 from arrbee/fix-index-add-bypath

In loose objects backend, constrain mkdir calls to avoid extra mkdirs
Merge pull request #1670 from arrbee/open-cloexec

Add O_CLOEXEC to open calls
Merge pull request #1672 from TheRealKerni/fix/header_docs

Fixed most documentation header bugs
Fix checkout tests on Windows
Merge pull request #1674 from arrbee/fix-checkout-target-dir-win32

Fix checkout tests on Windows