People who regularly exercise before the age of 50 are less likely to suffer from dementia in later life, new research has revealed.