remote: build up the list of refs to remove

When removing the remote-tracking branches, build up the list and remove
in two steps, working around an issue with the iterator. Removing while
we're iterating over the refs can cause us to miss references.
Merge pull request #2392 from libgit2/cmn/remote-delete

remote: build up the list of refs to remove