Onset of tearing modes in plasma termination on JET: the role of temperature hollowing and edge cooling