Long-term stabilization of carrier envelope phases of mid-infrared pulses for the precise detection of phase-sensitive responses to electromagnetic waves