Tentative deal averts U.S. railroad shutdown