Gold surged above $5,100 as investors sought safety amid geopolitical tensions and U.S. shutdown risks, extending a strong rally in precious metals.