Correcting Diffusion Generation through Resampling