Depression, anxiety and cognitive function in patients with type 2 diabetes: an 8-year prospective observational study