Hydraulic control of three-layer exchange flows: application to the Bab al Mandab