How life on tidally locked planets could survive