Chronic pain linked to increased dementia risk