John Ternus’s task is to transform the iPhone-maker for the AI era