Improve CVideo::get_available_resolutions.

If there is a main window use that else fall back to the original code.

Based on a patch by AI0867.