Effects of sex and gender on cardiovascular risk factors and mental disorders in a middle-aged population-based cohort