Pop legend Prince, who was found dead in his home in late April, died from an accidental overdose of painkillers, a medical examiner has revealed.