US Congress passes bill to avert government shutdown with just hours to spare