The tech useful for preventing these situations is exactly the kind that's frowned upon in civil liberties circles.
These people aren't victims. They made a choice.
Treating symptoms is never as useful as treating the underlying cause.
Like others have said the damage this is causing is mostly mental. The number of random (I mean that as in could happen to anyone not downplaying the significance of human life) deaths caused by terrorism is not so large.
However this does not mean we should tolerate people who refuse to play by the rules of society because of their personal beliefs (whatever they may be). Any countermeasures must be above board and transparently fair.