Surface sensitivity of Rayleigh anomalies in metallic nanogratings