Close files on file diff failure

Not closing the files on a diff failure ensures that clar
cleanup will fail on win32 because we still have the file open.
Tests for core.autocrlf and .gitattributes
Tests for crlf filtering into the repository
core.autocrlf=input w/ text=auto attr to workdir
Merge pull request #2110 from libgit2/ed/crlf_input

Handle `core.autocrlf=input` when checking out