With Democrats' help, Senate votes to avert a government shutdown