The former Duke of York has launched legal action against police and the courts over his arrest in relation to the Epstein files.