Energy diffusion of pickup ions upstream of comets