Local structure in crystalline and liquid tellurium probed by X-ray absorption spectroscopy