Allow progress callback to cancel fetch

This works by having the indexer watch the return
code of the callback, so will only take effect
on object boundaries.
Document callback-triggered cancellation
Enhance test coverage for transfer cancellation
Allow all non-zero returns to cancel transfers
Expect standard error code from internal calls
Merge pull request #1316 from ben/clone-cancel

Allow network operations to cancel
Merge pull request #1246 from arrbee/fix-force-text-for-diff-blobs

Add FORCE_TEXT check into git_diff_blobs code path
Initial implementation of similarity scoring algo

This adds a new `git_buf_text_hashsig` type and functions to
generate these hash signatures and compare them to give a
similarity score.  This can be plugged into diff similarity
scoring.
Some similarity metric adjustments

This makes the text similarity metric treat \r as equivalent
to \n and makes it skip whitespace immediately following a line
terminator, so line indentation will have less effect on the
difference measurement (and so \r\n will be treated as just a
single line terminator).

This also separates the text and binary hash calculators into
two separate functions instead of have more if statements inside
the loop. This should make it easier to have more differentiated
heuristics in the future if we so wish.
wip: adding metric to diff
Change similarity metric to sampled hashes

This moves the similarity metric code out of buf_text and into a
new file.  Also, this implements a different approach to similarity
measurement based on a Rabin-Karp rolling hash where we only keep
the top 100 and bottom 100 hashes.  In theory, that should be
sufficient samples to given a fairly accurate measurement while
limiting the amount of data we keep for file signatures no matter
how large the file is.