Apple is preparing for CEO Tim Cook’s possible departure, with John Ternus emerging as a top successor.