Senate passes funding bill to avert October shutdown