remote: prune refs when fetching
Add test for prune refs
Fix calls to `git_remote_download` and `git_remote_fetch`.
Test that prune overlapping works as expected.
Fix references to git_remote_lookup.
Cleanup after testing remote prune.
Cleanup repository after prune tests.
Make sure that `fetch --prune --tags` doesn't remove tags.
fetch: do set prune when testing

We load the remote again, so we need to ask the new remote to prune the
refs, or we're not exercising the code in our tests.
fetch: assert we don't call update tips when there are no upates

This is hiding a bug in the prune code, whereby we prune references we
shouldn't but don't notice it in the code afterwards because
update_tips() recreates them.

This means that we do perform changes to the references (and get rid of
the reflogs) when we shouldn't.
fetch: prune after updating tips

This makes a fetch+prune more similar to a connect+prune and makes it
more likely that we see errors in the decision to prune a reference.
fetch: perform prune in separate steps

For each remote-tracking branch we want to remove, we need to consider
it against every other refspec in case we have overlapping refspecs,
such as with

    refs/heads/*:refs/remotes/origin/*
    refs/pull/*/head:refs/remotes/origin/pr/*

as we'd otherwise remove too many refspecs.

Create a list of condidates, which are the references matching the rhs
of any active refspec and then filter that list by removing those
entries for which we find a remove reference with any active
refspec. Those which are left after this are removed.
fetch: add test for the other order of overlapping specs
fetch: remove the prune setter

This option does not get persisted to disk, which makes it different
from the rest of the setters. Remove it until we go all the way.

We still respect the configuration option, and it's still possible to
perform a one-time prune by calling the function.
fetch: plug leaks in the prune tests
Plug some leaks
Check the result of git_buf_joinpath
Added missing error handling path
Check for OOM
Merge pull request #2785 from jacquesg/coverity

Coverity fixes