Local correlations in liquid and supercooled gallium probed by x-ray-absorption spectroscopy