Phonon Collapse and Second-Order Phase Transition in Thermoelectric SnSe