The Duke of Sussex has lost his legal challenge to Britain changing his security arrangements after he stepped down from royal duties.