Prince Harry scored a legal victory in his long-running battle over security for him and his family in the UK.