-But what if the pilot/co-pilot takes down the flight attendant?-
I don’t think an airline can plan for every conceivable contingency; too costly for one thing. Maybe the flight attendant can have a firearm or taser at the ready.
Or possibly the armed flight attendant(s) can stand by while the door is firmly propped open. Presumably the pilot will only be gone a few minutes.
Political officer on every flight with a Makarov pistol. "Plane fly like capitalist squirrel, or party shoot you in neck."