NJ Transit and engineers union agree to new contract and avoid a possible strike