Theoretically if depression earlier in life protected against dementia (not likely at all but bear with me) it would actually raise the rates.
I wonder what the actual correlation is however even keeping in mind spuriousness.