Sounds like you handled it very well. Nobody, including the dog, got hurt. That is a lot to be thankful for right there.
You were completely and totally in the right, but I'm surprised that the owner didn't come unglued if he saw you draw down on his dog. Most dog owners wouldn't react well to that. The owner could have easily become a much more significant threat than the dog.
With the luxury of having time to think through this...
I would not risk shooting a dog in their own yard on the possibility that he was going to hurt us. Barking and growling is scary, but most of the time the dog will let it end there if you aren't being aggressive.
I'd try to position myself between the dog and my wife & child. If the dog is going to eat my kid, he is coming through me first. While I'm yelling at the dog to stop, I'm going to draw, turn weak side to the dog, brace for a hit, and protect the gun. Hopefully, we can be backing out of there and getting some distance between us and Cujo.
If the dog does not attack, then everybody gets to walk away.
If this really is a vicious animal, I'm going to get hurt and the dog will be shot.
Tactically- this plan stinks, but it is the only way I can see of being certain before pulling the trigger. While being bit is a MAJOR disadvantage, the good part is that the dog is a big target that close. If I get called into court, I'll tell my story as the simple truth: "The dog tried to kill me."
I would give the dog less leeway if he came onto my property or if we were in neutral/common ground.