The US Senate has approved a spending bill to prevent a government shutdown, sending it to President Biden for final approval.