A steel flight deck door, well locked is now a must. A video camera looking at the pax cabin(s) is also essential. Any sign of terrorist activity and a pilot should be able to discharge a harmless knockout gas into the pax cabin and land the aircraft asap. Upon landing the terrorists can be dealt with whilst still unconcious.
True this method will probably not spare the lives of all on board, but bear in mind the alternative. May all those poor souls rest in peace.