gutils/gimagereadxpm.c test for errors and cleanup

If any file errors found, or not enough memory available, then cleanup anything which is open, and then exit with NULL.
NOTE: There is an XPM3 library that takes care of all cases, so may be worth using.