Too much or too little magnesium can raise dementia risk