but they can still go through the magma pipe.
Have cave-in stoppers(natural wall falls across passageway, from sealed room directly above, best through the floor of said room) above both pipelines and all access-ways just in case some of them can get through fortifications.
Alternatively, accept your fate at the hands of the happy fun stuffs or face the fury of their lag as they all repeatedly try to path to your dwarves even though they can't. You'd think it entirely possible to code that each one try to path a few times, then only retry it once a minute/every other minute/10k ticks until they actually find a route, THEN follow it until they can't, repeat. This would work even better if only one of them is allowed to make pathing attempts to your dwarves while everyone else idles, until it succeeds, then goon swarm you, stopping if the path suddenly breaks/you sent them a kitten. Then again that probably isn't possible, or it would have been done.
it's bloody unplayable, even with only 10-20 dwarves, little to no other creatures, and a very very tiny fortress, it takes 5 seconds for even the hfs to move a tile, when they HAVE access to you. They're supposed to be nigh-invincible monsters with claws and stuff, not beings of pure processor-murder.
And if you want to wage war on your computer too, breed 200 cats and throw them in there, reportedly they'll breed faster than they are killed, and sometimes they spontaneously become awesome warriors and kill something bigger than them. Be prepared for tantrum spirals as the cats adopt people while being killed. I also like how the local wildlife fairs better against them than your highly-trained, well-armed soldiers in strategically advantaged positions, even though they should be very easy for the hfs to kill. It's like rock paper scissors, dorfs>animals>hfs>dorfs. My dorfs manage -15 hfs kills, elk birds and crundles get +5, I have +30~ animal kills vs idiots getting eaten by crundles/stairway birds, damn they love sunlight.
ok, I'm done blurting out things that couldn't possibly help you. except the animals thing, that could be useful. Fear the crundles that disperse when you approach but the one you catch still manages to rip your head off, invincible monsters!