Survival as a function of HbA1c in people with type 2 diabetes: a retrospective cohort study