US lawmakers reach tentative deal to avoid government shutdown