revparse: do look at all refs when matching text

Now that we no longer fail to push non-commits on a glob, let's search
on all refs when we rev-parse syntax asks us to match text.
docs: produce literal asterisks
commit: faster parsing

The current code issues a lot of strncmp() calls in order to check for
the end of the header, simply in order to copy it and start going
through it again. These are a lot of calls for something we can check as
we go along. Knowing the amount of parents beforehand to reduce
allocations in extreme cases does not make up for them.

Instead start parsing immediately and check for the double-newline after
each header field, leaving the raw_header allocation for the end, which
lets us go through the header once and reduces the amount of strncmp()
calls significantly.

In unscientific testing, this has reduced a shortlog-like usage (walking
though the whole history of a branch and extracting data from the
commits) of git.git from ~830ms to ~700ms and makes the time we spend in
strncmp() negligible.
utils: don't reimplement strnlen

The standard library provides a very nice strnlen function, which knows
to use SSE, let's not reimplement it ourselves.
Split p_strlen into its own header

We need this from util.h and posix.h, but the latter includes common.h
which includes util.h, which means p_strlen is not defined by the time
we get to git__strndup().

Split the definition on p_strlen() off into its own header so we can use
it in util.h.
Merge pull request #2103 from libgit2/cmn/parse-commit-faster

commit: faster parsing
Merge pull request #2094 from libgit2/cmn/push-non-commit

Add flexibility to the revwalk API
Merge pull request #2027 from libgit2/rb/only-windows-is-windows

Some tests of paths that can't actually be written to disk
Merge remote-tracking branch 'libgit2/development' into bs/more-reflog-stuff
Fix a few references to changed function signatures
Prevent user's merge.conflictstyle from breaking tests
Fix broken clone test
Avoid crash when skipping remote test
More merge.conflictstyle fixes
Remove unused utf8 -> utf16 conversion code
Only run clone-failure test on private repo
Merge pull request #2104 from ethomson/utf8_cleanup

Remove unused utf8 -> utf16 conversion code
Fix terrible indentation
Correct default reflog message for git_remote_fetch
Merge pull request #2100 from libgit2/rb/update-pqueue

Replace priority queue code with implementation from hashsig