Build fixes and warning fixes after SDL 2.0 change

Unbreak --disable-editor which affected the PSP and GP2X builds.

I've also fixed some warnings that have built up over the last couple of years but I neglected. Most of the ports build without any warnings at all now. The remaining warnings are either trivial (just unfixable -pedantic things) or bugs in dependency headers (such as the mingw zlib warnings).