A £500m deal to end the two-year ownership impasse at the Daily Telegraph has been agreed "in principle", it has been announced.