Taking steps to prevent malicious logouts would mean that you're creating cases where a logout will not succeed. This opens the possibility of having a bug that prevents people from logging out at all, even if they want to.
Would you rather have a bug that allows logouts, or a bug that prevents them?
That said, I would love for Facebook to put this snippet in their footer.