The justices seemed by turns relucant to break up an exhaustively negotiated agreement, but also leery of somehow rewarding the Sacklers.