git_reference_next_name must match git_reference_next

The git_reference_next API silently skips invalid references when
scanning the loose refs.  The git_reference_next_name API should
skip the same ones even though it isn't creating the reference
object.

This adds a test with a an invalid loose reference and makes sure
that both APIs skip the same entries and generate the same results.
Use pool for loose refdb string allocations

Instead of using lots of strdup calls, this adds a memory pool to
the loose refs iteration code and uses it for keeping track of the
loose refs array.  Memory usage could probably be reduced even
further by eliminating the vector and just scanning by adding the
strlen of each ref, but that would be a more intrusive changes.

This also updates the error handling to be more thorough about
checking for failed allocations, etc.
Fix warning message about mismatched types
Update init and clean for revwalk::basic tests

The new tests don't always want to use the same fixture data as
the old ones so this makes it configurable on a per-test basis.
Merge pull request #1732 from libgit2/revwalk-glob-should-ignore-invalid

Invalid refs on disk cause revwalk globbing to fail
Clean up some documentation

clang's docparser highlighted these.
remote: fix git_remote_download() documentation

The description of what the function does hasn't been true for quite a
while. Change it to reflect the way it currently works.

While here, remove an even older comment about missing features that
have been implemented.
Merge pull request #1745 from libgit2/doc-fixes

Doc fixes