Merge pull request #3304 from libgit2/cmn/checkout-free-stream filter: make sure to close the stream even on error