Prince Harry and the publisher of The Sun's trial is "very close" in negotiations on a potential settlement, the High Court has heard.