The Duke and Duchess of Cambridge have thanked 99-year-old Captain Tom Moore, who has raised more than £17 million for the NHS by walking 100 laps of his garden.