Millions of iPhone owners will share in a financial settlement Apple is paying over older devices running slowly.