Effects of diffraction in multiple-grid telescopes for X-ray astronomy