Remove ignored files from the working directory if they were stashed
Merge pull request #2155 from jacquesg/stash-save-remove-ignored

Remove ignored files from the working directory if they were stashed
pack-objects: free memory safely

A few fixes have accumulated in this area which have made the freeing of
data a bit muddy. Make sure to free the data only when needed and once.

When we are going to write a delta to the packfile, we need to free the
data, otherwise leave it. The current version of the code mixes up the
checks for po->data and po->delta_data.
Merge pull request #2157 from libgit2/cmn/write-object-mem

pack-objects: free memory safely