Fixing OSLib not building with a modern toolchain

Changes (years ago) in the PSP SDK left OSLib unable to build, and with libpng and libjpeg's internal assertation on their linked versions failing after those were updated as well, this resulted in new builds using OSLib being unable to use anything that calls upon those two libraries.

This adds the few changes needed to make it build again.