A JetBlue captain had to be restrained by passengers after he was locked out of the cockpit by his co-pilot.