Spain agrees investment plan with Airbus to save jobs