Amazon has agreed to a settlement with European Union regulators that will force the company to make significant changes to its business practices but also allows the e-commerce giant to avoid a drawn-out legal fight and billions of dollars of potential fines, according to three people with knowledge of the deal.