The interstellar extinction and distance modulus to M10 from infrared photometry