In our grownup minds, changing a dog's name is no big deal. In your son's friend's mind, it IS a big deal. To him, it's a major part of the pup's identity. We don't realize how important a name is until we run into something like this.
I think you handled it well, and you don't need to feel too bad about it. If it comes up again, assure the boy - who obviously has a heart for his family's former dog - that you had to change the name a little so your boys wouldn't be calling the dog by the cousin's name, and that would help keep peace in your family! Be sure to tell the boy that you appreciate all he did for the dog (even if it was just playing).
I love the "middle name" business!
Actually, I laughed when I read your note, because I'm, um. definitely not a kid, but I ran into that. We raised a wonderful pup for Canine Companions for Independence. She was named before we got her, and she was - and is - a terrific dog; however, she had to be released from CCI for medical reasons. A wonderful couple with whom we are now friends adopted her, and she couldn't have better owners! However, the first thing they did was change her name to something that was very similar but sounded less old-fashioned. There was no real reason for me to have trouble with it, but I did have some, because she was one of my four-footed babies! I call her by her new name when I see her, but I still have her old name in the back of my mind!