Measurement of the longitudinal and transverse beam coupling impedances in the elettra cavity