GUI: Fix for potential bad cursor palette access in warning case.

Previously, if the colorsFound exceeded the maximum number of
cursor colors, a bad access to the cursor palette buffer could be
performed before the warning was emitted. This reordering avoids
that.