Retrieving squeezing from classically noisy light in second-harmonic generation