A study found people who took vitamin D supplements were less likely to develop dementia. But experts said other factors may have been the reason for the reduced risk.