The Democratic Senate minority leader suddenly decided to back the GOP’s spending bill to avert a government shutdown.