Structural study of the high-temperature phases of the hexagonal perovskite KNiCl3