On the C/H and D/H ratios in the atmospheres of Jupiter and Saturn