Relation of sleep quality and sleep duration to type 2 diabetes: a population-based cross-sectional survey