Apple has agreed to pay $50 million to settle a class action lawsuit from customers who say they experienced failures related to the so-called "butterfly" keyboards included for years on certain MacBook laptops.