Clean up + improve setting gamma via xRandR

* save gamma on start and restore on exit
* handle errors
* Restore SDL1.2 compatibility