3M has agreed to pay more than $6 billion to settle hundreds of thousands of lawsuits brought over its dual-ended combat earplugs.