file-xwd: sanity check colormap size (CVE-2013-1913)

(cherry picked from commit 3997c7188a71dc8fc4c6a7513061180cbbd3590e)
file-xwd: sanity check # of colors and map entries (CVE-2013-1978)

The number of colors in an image shouldn't be higher than the number of
colormap entries. Additionally, consolidate post error cleanup in
load_image().

(cherry picked from commit f597355beffd9e483e11407d4c3b56f32db3634d)

Conflicts:
	plug-ins/common/file-xwd.c