Copy git_merge__bases_many() for new ahead-behind code

To be used as a basis for a function which marks nodes with parents
up to the merge base.
Morph copy of git_merge__bases_many() -> mark_parents()

Integrate mark_parents() with the ahead_behind() code.
Fix no_common_ancestor test for ahead_behind count

Ahead-behind count is still a valid operation, even if the two
commits don't have a common merge-base. The old implementation was
buggy, so it returned ENOTFOUND. Fixed now.
Fix mark_parents() to account for bad luck traversals

If commit timestamps are off, we're more likely to hit a traversal
where the first path ends up traversing past the root commit of the tree.
If that happens, it's possible that the loop will complete before the second
path marks some of those final parents. This fix keeps track of the root
nodes that are encountered in the traversal, and verify that they are
properly marked.

In the best case, with accurate timestamps, the traversal will continue
to terminate when all the commits are STALE (parents of a merge-base), as
it did before. In the worst case, where one path makes a complete traversal
past a root commit, we will continue the loop until the root commit itself
is marked.
Fix a bunch of leaks, error handling cases
netops: properly handle GITNO_CONNECT_SSL_NO_CHECK_CERT

Don't return an error just because GITNO_CONNECT_SSL_NO_CHECK_CERT is
set.
netops: on SSL teardown only send shutdown alert

According to man 3 SSL_shutdown / TLS, "If a unidirectional shutdown is
enough (the underlying connection shall be closed anyway), this first
call to SSL_shutdown() is sufficient."

Currently, an unidirectional shutdown is enough, since
gitno_ssl_teardown is called by gitno_close only. Do so to avoid further
errors (by misbehaving peers for example).

Fixes #1129.
Make goto cleanup more consistent

There may be some question about whether this is likely to be needed
at all, but that's above my head at the moment.
Only add deps/http-parser to include-dirs if required
DRY: Scan for regex.c only in one place
Search for zlib unconditional

Up to now, on windows we don't even bother to look if the user has a zlib
available somwhere.

In almost all larger commercial projects i've participated in, it was not
at all uncommon to have such a dependency somewhere in the source tree and
use it whereever required.
Searching for it, even if it's unlikely to be present, allows for such a
scenario (i.e. by prefilling the CMake-Cache).
Remove src/compat/*.c from source globs

This directory doesn't exist.
Remove special case source globs for Solaris

With the src/compat/*.c glob removed, there is no longer a difference to
the default globs we use for the IF( UNIX ) case.
DRY: Don't repeat globs for libgit2's own source files
Collect configuration options at the top of the file

- Also document the -DSTDCALL even better.
DRY: Add function that adds os-specific libraries to our targets
MSVC: Don't list all source files in an endless list

Instead tell MSVC to group the source files by directory.
revwalk-test: Don't leak the second repository
clone-empty-test: Don't use one pointer for two things

... so we can clean up correctly.
Fix some leaks and (possibly) dangling pointers in tests

Also adds some asserts.