defer palette update until SDL_Flip()

this cuts way down on the ugly palette swap artefacts that have been present
ref: http://openxcom.org/forum/index.php/topic,875.0.html
fix for research completed palette

multiple 16-color updates in a row; actually not sure how any of the 16-color
update cases were working
make ResearchState preserve Geoscape palette

NewResearchStateAvailable can push ResearchState which resets all 256 colors
If it's followed by further notifications, they are displayed in an incorrect
palette. This change makes ResarchState save its palette and restore it on OK
click; thus harmony is restored.
Merge pull request #266 from hmaon/palette_fix

palette code changes