tests: Introduce count_config_entries_match() helper
remote: Introduce git_remote_delete()
remote: move branch upstream deletion to use an iterator

This should make it more readable and allocate a bunch fewer strings.
Undef lseek first
_InterlockedExchange expects a volatile LONG
git_pool_mallocsz takes an unsigned long
Initialize local variable
Add R bindings to the README
Some coverity inspired cleanups
Increase use of config snapshots

And decrease extra reload checks of config data.
Merge pull request #2348 from stewid/add-link-R-bindings

Add R bindings to the README
Merge pull request #2349 from libgit2/rb/coverity-fixes

Increase config snapshot usage
Merge pull request #2351 from linquize/init-var

Initialize local variable
Fix mutex init/free in config_file.c
Better search path sandboxing

There are a number of tests that modify the global or system
search paths during the tests.  This adds a helper function to
make it easier to restore those paths and makes sure that they
are getting restored in a manner that preserves test isolation.
pack: init the cache on packfile alloc

When running multithreaded, it is not enough to check for the offmap
allocation. Move the call to cache_init() to packfile allocation so we
can be sure it is always allocated free of races.

This fixes #2355.
Merge pull request #2356 from libgit2/rb/restore-search-paths

Better global search path sandboxing in tests
Merge pull request #2357 from libgit2/cmn/pack-cache-init

pack: init the cache on packfile alloc
remote: remove remote-tracking branches on delete

When we delete a remote, we also need to go through its fetch refspecs
and remove the references they create locally.
Merge pull request #2313 from libgit2/cmn/remote-delete

Remote deletion