If Obama had lost the election then John McCain would have won, unless dissatisfaction with the Republicans are so great that Ralph Nadar actually wins. Had Nadar, or any third party candidate had won, then maybe there would be riots.
Truthfully, if Obama had not won I doubt there would have been riots. However, it is likely that the Democrats wouldn't have accepted the result - they are always in some sort of denial - and probably we would have Hillary Clinton announce her candidacy for 2012 next Monday.
I suspect that in light of a Democrat victory there won't be any further inquiries into voter fraud or problems with machines - while if there had been a Republican victory one would have been hearing about the necessity of inquestions to see what went wrong. The Democrats had someone who was able to win of his own this years, now it will be interesting to see if he can govern.