Pairing in spherical nuclei: Quasiparticle random-phase appropximation calculations with the Gogny interaction