A tentative six-year contract agreement between longshoremen and ports has averted a potential strike that could have disrupted the U.S. economy.