Getting involved in a confrontation over out of control dogs, when you've got a firearm with you, is a very tricky situation to be in. It would be easy to think that the firearm somehow gives you the upper hand, but it doesn't. Quite the opposite.
I know, from personal experience, how these situations can develop, and I suggest that quite a few of the posters on here do not have that experience.
The three golden rules are:
1) Unload your firearm and place it in its slip (if you have one), or sling it over your shoulder, or even lay it on the ground (you can always place your foot on it). Anything so long as it's not actually in your hands.
2) Never threaten to shoot the dog, or even suggest that you would be within your rights to do so.
3) Report the incident immediately. It may seem insignificant to you, but if the dog owner rings in first with a tall tale you will be the loser.
Also goes without saying that, if possible, use your phone to record the encounter.
I'm not commenting on how the OP handled the situation, just giving advice to anyone who might find themselves facing a similar scenario.