remote: make match_refs() copy src ref before assigning to peer_ref