Wavefront curvature sensor with phase defocus grating