Determination of the I2 bond-length distribution in liquid, solid, and solution, by extended x-ray absorption fine structure spectroscopy