After trading higher for much of the day, the stock market sold off in the last hour and a half of trading, following news that early exit polls showed Senator Kerry ahead of President Bush in all three critical swing states. At the closing bell, most indexes were little changed from yesterday’s close.