So, interestingly, this is now the 4th incident (that we know of, it has been suspected in others like MH370) in the past 18 years where a pilot carried out a mass killing.
http://www.bbc.com/news/world-europe-32063587
Ignoring everything else (hard, I know), you have to wonder if there is a technological solution to incidents like this. ie. an emergency button somewhere else in the plane that might not grant access to the cabin, but would put the plane on autopilot, then land it automatically.
We're obviously not there yet, but probably could be pretty quickly if necessary.