I don't see how Brexit would make us magically safe from such terrorism. Slightly safer, at a pinch, but only if we turned the UK into a fortress, and cut ourselves off from Europe entirely. But then what about possible incoming terrorists from the rest of the world? Are we going to treat everybody as a potential threat unless they can prove otherwise? Is that not equally damaging, given the loss of all immigrants including those who do contribute, often immensely, to our society?
But even supposing it were worth it for us... this attack happened in Brussels. Leaving the EU certainly wouldn't make the rest of it any safer. If the EU closed its borders completely tomorrow it wouldn't make much difference. What will is better security, and better coordination of security forces both between and within each country in the EU.
It's a desperately sad piece of news. This morning as reports flew in people were injured. Then one person was dead. Now, at least 20 and possibly more still. I'm sure that everyone feels equally horrified, even if they react to the event differently politically.