Add support for some BSDs and Solaris to SDL_GetBasePath().

--HG--
extra : rebase_source : d2c9bc42ea618bcafdf8ec6c24d35d3123741fc6
Patched to compile on FreeBSD.