The Rhode Island-based pharmacy giant reported billions in losses despite increasing sales, and executives pointed to the recently-announced $5B opioid settlement as one reason.