Scientists have found that those who drink lots of coffee were less likely to develop dementia or have age-related cognitive decline.