refs: failing test for concurrent ref access

If we remove a reference while we're iterating through the packed refs,
the position in the iterator will be off.
refs: copy the packed refs on iteration

This lets us work without worrying about what's happening but work on a
snapshot.
Merge pull request #2395 from libgit2/cmn/ref-iter-concurrent

Concurrent ref iterator access