Somebody with severe mental health problems gets obsessive and violent, and then kills somebody.
Anything to do with religion? I wouldn't say somebody so deranged is done any favours by having such fantastical nonsense in his mind, perhaps someone he knew may even have foolishly and arrogantly offered him religious council or to pray the demons the way? Fuck load of good it would have done though, hey? But not even me, a raging anti-theist, isn't gong to come to such a ridiculous conclusion and blame religion for this.
Could it have been prevented? If he was known to the relevant authorities and agencies and they have "let him loose" (I don't mean he should be treated as a prisoner before anyone gets on their high horse) without proper supervision and checks, or when he should have been in residential care for his own and the public's safety. Then yes I would say there may be people who could have and perhaps should have acted differently.
Although that is just speculation for now, and without suggestion that he was known to have mental health issues we can't play the blame game.
Ignore the terrorism element, which I believe doesn't exist anyway, lets treat it as a murder- can we prevent all murders? Not in a relatively free society, we can't. And not one of you would give up your freedoms for such a society, if such an Equilibrium like utopia could ever exist in the real world.
Should we be scared? No. Should this be used to stir up hatred of Muslims? Absolutely not and if it enters the news, the real story must come out and the public should be told what really happened and stop any tensions rising.