SDL_image, SDL_mixer: Fixes for memory leaks and null pointer dereferencing

I submitted patches to http://bugzilla.libsdl.org/show_bug.cgi?id=1268
and http://bugzilla.libsdl.org/show_bug.cgi?id=1269 that fix errors
found by cppcheck. The patched files include IMG_xpm.c in SDL_image
along with mixer.c and timidity/readmidi.c in SDL_mixer.

Joshua Beck