Mitigating the cycle-skipping of full-waveform inversion by random gradient sampling