Disable BUILD_GUI when BUILD_OFFSCREEN is available.

Also simplify the logic for the offscreen option.