Infrared line emission from H II regions. II. Airborne observations of the Orion Nebula, W3, and NGC 7538.