Deal with formats SDL_image can't reentrantly load.

It seems like SDL_image has problems reentrantly loading some
formats, certainly GIF and maybe TGA and BMP. So we whitelist
the common formats (png and jpeg), and lock loads of the rest.

Fixes #426.