don't read uninitialized values when changing resolution

When changing the window resolution, the game state is changed to
'null', calling resol_leave() and free'ing the mode-list. Then its value
is passed to video_mode(), resulting in garbage and wrong window size.
The width and height values are saved to local temporary variables
before changing the state, thus passed values are now correct.

This partially fixes issue #3.
destroy window and GL context on mode-setting

When graphical settings are changed, video_mode() is called. Another
window was created, without destroying the old one. This is now fixed.
GL context is also tracked and destroyed when needed.

This fixes issues #1 and #3.