Johnson & Johnson’s Ethicon Inc. unit has agreed to pay nearly $10 million to Washington Attorney General Bob Ferguson to settle the first lawsuit brought by a state over its transvaginal mesh devices.