Add SDL 2.0 compatibility.

Replaced events::discard with SDL_FlushEvent for SDL 2.0 and added
SDL_FlushEvent emulation for SDL 1.2.

git-svn-id: http://svn.gna.org/svn/wesnoth/trunk@56435 75b3775d-3801-0410-9e12-e2e43121521d