X-ray absorption spectroscopy study of ReO3 lattice dynamics