The relation between X-ray activity and rotation in intermediate-mass G giants