Up to a third of people with type 2 diabetes will develop heart failure, kidney disease or die within five years of diagnosis, a major study has found.