That's known as the Bradley Effect or the Wilder Effect. In the case of Doug Wilder running for the governorship in Virginia, Tom Bradley running for governor of California, in pre-election polls they had huge leads, and going into Election Day it was assumed (both candidates were black) both were going to win. They both lost by sizable percentages. The pollsters decided, "We've been lied to here. People didn't want us to think that they were racist so they told us they were going to vote for Bradley or Wilder when they really had no intention of it." So it's interesting how many people are actually answering questions about Obama that way.
* The reality is that Bradley barely lost while Wilder barely won.