Added Vsync/Swap tearing support through SDL.

+ UI and settings save.

Fixes #416
Cleaning up a resource on failure.