The tentative deal comes just days ahead of a possible strike at the plane maker’s main factories.