People with diabetes who undergo cancer surgery are more likely to die in the month following their operations than those who have cancer but not diabetes, an analysis suggests.