psxbios: Fixes save issues on Parasite Eve II, Parasite Eve I and others
Merging never-merged fix by Solus for Parasite Eve. I also fixed some GCC warnings
about dir->name going out of bounds too.
We also make sure to only add '/0' if string is not full and right after the last character in the dir array.
This fixes saving/loading in Parasite Eve II, Parasite Eve.
It also fixed regressions for the LEGO Racers where other games would break,
meaning this should be the proper fix for saves.
We're also using our own strlen implementation to avoid any issues or
relying on the libc's own strlen.