Serum magnesium is associated with the risk of dementia