status: fix handling of filenames with special prefixes

Fix libgit2/libgit2sharp#379
This refs iterator pleases the gods.
Liike this
What are the chances, really
...Aaaand this works
Refcounting
Frees
Make iterators use GIT_ITEROVER & smart advance

1. internal iterators now return GIT_ITEROVER when you go past the
   last item in the iteration.
2. git_iterator_advance will "advance" to the first item in the
   iteration if it is called immediately after creating the
   iterator, which allows a simpler idiom for basic iteration.
3. if git_iterator_advance encounters an error reading data (e.g.
   a missing tree or an unreadable file), it returns the error
   but also attempts to advance past the invalid data to prevent
   an infinite loop.

Updated all tests and internal usage of iterators to account for
these new behaviors.
Zero memory for major objects before freeing

By zeroing out the memory when we free larger objects (i.e. those
that serve as collections of other data, such as repos, odb, refdb),
I'm hoping that it will be easier for libgit2 bindings to find
errors in their object management code.
Mutex init can fail

It is obviously quite a serious problem if this happens, but mutex
initialization can fail and we should detect it.  It's a bit like
a memory allocation failure, in that you're probably pretty screwed
if this occurs, but at least we'll catch it.
Merge pull request #1627 from arrbee/iterator-api-improvements

Make iterators use GIT_ITEROVER & smart advance
Merge pull request #1624 from libgit2/vmg/full-ref-iterator

Breaking RefDB changes
Merge pull request #1633 from jamill/directory_create_fix

Allow creation of directories under the volume root in Win32
Ensure git_futils_mkdir won't mkdir root

This makes sure that git_futils_mkdir always skips over the root
directory at a minimum, even on platforms where the root is not
simply '/'.  Also, this removes the GIT_WIN32 ifdef in favor of
making EACCES as a potentially recoverable error on all platforms.
Merge pull request #1634 from arrbee/alternative-mkdir-fix

Ensure git_futils_mkdir won't mkdir root
I'm a dick
Simplify git_futils_mkdir

This routine was (is) pretty complicated, but given the recent
changes, it seemed like it could be simplified a bit.
Basic function context header

This implements a basic callback to extract function context for
a diff.  It always uses the same search heuristic right now with
no regular expressions or language-specific variants.  Those will
come next, I think.
Move some diff helpers into separate file
Make mkdir early exit cases clearer

There are two places where git_futils_mkdir should exit early or
at least do less.  The first is when using GIT_MKDIR_SKIP_LAST
and having that flag leave no directory left to create; it was
being handled previously, but the behavior was subtle.  Now I put
in a clear explicit check that exits early in that case.

The second is when there is no directory to create, but there is
a valid path that should be verified.  I shifted the logic a bit
so we'll be better about not entering the loop than that happens.