Robust shot-noise measurement for continuous-variable quantum key distribution