Senate works to avert partial government shutdown ahead of midnight deadline