McKinsey agrees to pay $574m to US states to settle opioid claims