The U.S. House passed a stopgap spending bill to avert a government shutdown, giving lawmakers another week to hammer out a deal on the budget.