The impact of COVID-19 pandemic on training and mental health of residents: a cross-sectional study