The effects of family structure and function on mental health during China’s transition: a cross-sectional analysis