SDL: Fix bug where config file path could exceed maximum path length.

The fix is the change in the MAXPATHLEN check, but have also migrated
this to Common::String to make the fix easier.

Thanks to klusark for pointing out this problem.