The U.S. Senate has approved legislation to temporarily fund the government, a key step toward averting a federal shutdown after President Trump backed off his demand for money for a border wall with Mexico.