Significant phonon anharmonicity drives phase transitions in CsPbI3