Make core.safecrlf work on LF-ending platforms

If you enabled core.safecrlf on an LF-ending platform, we would
error even for files with all LFs.  We should only be warning on
irreversible mappings, I think.
Just don't CRLF filter if there are no CRs
smart: send a flush when we disconnect

The git server wants to hear a flush from us when we disconnect,
particularly when we want to perform a fetch but are up to date.
Fix a leak in the tests
Minor fix for cmn/clone-into-mirror.

A recently added check might skip initialization of old_fetchhead and go
directly to cleanup. So, destruct in the opposite order of construction.
Merge pull request #2373 from kitbellew/fix-clone-into-mirror

Minor fix for cmn/clone-into-mirror.
smart: store reported symrefs

The protocol has a capability which allows the server to tell us which
refs are symrefs, so we can e.g. know which is the default branch.

This capability is different from the ones we already support, as it's
not setting a flag to true, but requires us to store a list of
refspec-formatted mappings.

This commit does not yet expose the information in the reference
listing.
remote: expose the remote's symref mappings

Add a symref_target field to git_remote_head to expose the symref
mappings to the user.
local transport: expose the symref data

When using the local transport, we always have the symbolic information
available, so fill it.
remote: add api to guess the remote's default branch

If the remote supports the symref protocol extension, then we return
that, otherwise we guess with git's rules.
clone: make use of the remote's default branch guessing

Let's use the remote's default branch guessing instead of reinventing
one ourselves with callbacks.
clone: get rid of head_info

Since we no longer need to push data to callbacks, there's no need for
this truct.
Merge pull request #2372 from libgit2/cmn/fetch-terminate

smart: send a flush when we disconnect
Include windows.h on win32 for Sleep
Merge pull request #2379 from ethomson/status_win32

Include windows.h on win32 for Sleep
Merge pull request #2375 from libgit2/rb/safecrlf-on-lf-platform

Make core.safecrlf not generate an error on LF-ending platforms
Merge pull request #2376 from libgit2/cmn/remote-symref

Add support for the symref extension
Plug leaks and fix a C99-ism

We have too many places where we repeat free code, so when adding the
new free to the generic code, it didn't take for the local transport.

While there, fix a C99-ism that sneaked through.
smart: initialize the error variable
odb: clear backend errors on successful read

We go through the different backends in order, so it's not an error if
at least one of the backends has the data we want.