A cheap diabetes drug taken by millions could ward off the most common cause of blindness, a study has found.