Introduce git_diff_blob_to_buffer
Share git_diff_blobs/git_diff_blob_to_buffer code

This moves the implementation of these two APIs into common code
that will be shared between the two.  Also, this adds tests for
the `git_diff_blob_to_buffer` API.  Lastly, this adds some extra
`const` to a few places that can use it.
Merge pull request #1204 from arrbee/diff-blob-to-buffer

Have diff blob to buffer share code (and add tests)