Deforestation has killed more than half a million people in the tropics over the past two decades as a result of heat-related illness, a study has found.