Get the dog a chest harness, even the most well trained ones succumb to sandwiches and put the lead around the seatpost. In fact leads are not the best, you need something stiff, like one of those wire extensions that go on ground stakes.
Any pull is then a) not on the dogs neck b) below your centre of gravity and does not do anything but jolt you.
This works well and I've cycled 7 miles with my dog like this, though normally we go somewhere he can run. The way you've done it, as you've discovered, is an accident waiting to happen.
I've never succumbed to those huge contraptions which affix to your bike because I don't want to affix them to my bike, they don't look any better than the seatpost method and they look dangerous in the event of an accident.