Early last year, UPS began scaling back the amount of work it was doing for Amazon. Although the partnership generated plenty of revenue, it was also crimping profits.