gutils/gimagereadras.c fread should return 1. 0 is an error
hush warning about makePrintable() during make (this is a debug routine)
Unknown function/script-file should be reported in the context of the caller.

This results in a more useful error message containing the filename
and line number at which the attempted call was made.
Test for file open and report error in gutils/gimagereadrgb.c
Check for file errors in gutils/gimagereadrgb.c

Changed getlong and getshort to test for file errors.
Modified getsgiheader readlongtab and other places to exit if file error.
Updated gutils/gimage.c, don't segfault if GImage does not exist yet.
In gutils/gimagereadrgb.c, moved header checks into common routine above.
Exit with NULL if not enough memory in GImageCreate(). Also init ret=NULL
Skip reading the rest of image file if magic number does not match.
In gutils/gimagereadrgb.c, convert r,g,b,a, galloc & gfree to malloc & free

Convert to more standard malloc and free method, plus return error if out
of memory.
Moved the "if ( header.bpc==1 ) {" so that we only need one set of malloc
instead of two.
Split the error exit so that we don't need to report file error if it is
actually a memory problem.
In gutils/gimagereadrgb.c, convert freetab, starttab to malloc & free

Convert to a more standard malloc and free method, plus return error if
out of memory.
In gutils/gimagereadrgb.c, a few long fixes for readlongtab & freeptrtab
In gutils/gimagereadrgb.c, check for file input error and exit.
In gutils/gimagereadrgb.c,, return error if failed to add more memory.
better definition for header in gutils/gimagereadrgb.c

One of the RGB encodings doesn't appear right, so had to seek definitions.
In gutils/gimagereadrgb.c, make find_scanline() check for file errors.

while routine seperated since getthingamy expected to use old getlong(fp).
In gutils/gimagereadrgb.c, corrected color scale for {0..255)
Fix comment.
And another comment fix.
Merge pull request #307 from blipvert/fixes/3

Check if SplineChar defines a fg layer before trying to iterate its refs