The dollar gained against a basket of currencies on Wednesday after Democrats looked unlikely to take control of the U.S. Senate, leading investors to unwind bets that a large fiscal package is likely.