Quantum key distribution with an efficient countermeasure against correlated intensity fluctuations in optical pulses