People who are both severely obese and have type 2 diabetes may benefit from weight loss surgery, a new analysis suggests.