Prevalence of and factors associated with nightmares in the elderly in a population based cohort study