Resonant x-ray scattering study of diffuse magnetic scattering from the topological semimetals EuCd2As2 and EuCd2Sb2