Smoking raises risk of midlife memory loss