An in situ structural study on the synthesis and decomposition of LiNiO2