S&P affirms US credit rating