Gardening may stave off dementia, study finds