Two drug companies have agreed to a $54 million settlement in San Francisco's opioid trial on Tuesday, just as closing arguments were set to begin.