Doctor accused of illegally prescribing opioids gives up license