My oldest horse used to do that to me. I can't tell you how many times we had a perfect trail ride and then suddenly he would go... and go... and the speed would intensify. I would have his nose touching my knee while he ran straight ahead. I would jerk and pull and get mad. My remedy probably won't work for you and it wasn't exactly safe. I would swing my leg out of the saddle as if I were dismounting. He thought he won because I was getting off so he would slow or stop and then I would plant my seat back in the saddle but this time I'd be ready and spin circles without allowing him to stop. I sometimes would spend thirty minutes spinning circles as I went down a trail. I didn't have a trainer back then. I was a know it all teen and there was no horseforum so I figured things out as I went. They may not have been the smartest options but they worked.
I wasn't typing this to give any kind of advice, I just remember going through what you described and I wanted to respond so that you know you aren't the only one this has happened to.
I was never brave enough to run him into an object because I didn't think he would stop.
Trigger. This was Trigger. Still is, but he's listening better these days. We still have to do the cool down circles, and sometimes I do what you did - act like I'm getting out of the saddle. He'll stop every time. I don't always get out of the saddle though.
Conversely, Leroy, whom I sold because he was a pig headed lout, would get set on a single course/direction, and wouldn't stop. It wasn't that he was running away with anyone, he just wouldn't acknowledge any attempts at changing his direction. He'd brace against the bit, wouldn't turn his head, and even keep walking forward with his head snugged up against your leg.
I fully believe he'd have walked off a cliff and killed himself and whoever was on him, he would get so dead set on having his way, no matter the terrain. If he could see a line through the woods, down a mountain, or across a road, he was by God going and it didn't matter where his feet went or that you, the person, couldn't fit under the tree limbs or didn't want to get raked through the honey locust trees, or hit by a bus. He was going straight on.
My daughter 'let' him do it one time with her... and he wasn't paying attention, he was fighting so hard to not go around a tree, that he plowed right into it, headfirst. Skinned his noggin and rung his bell, he hit it so hard.
Didn't change his way of thinking though. That's why I sold him. He was going to get someone hurt with his pig-headed, stubborn fit throwing.