Lung disease in middle age linked to dementia later in life