[WIP][HttpFoundation] fix pathinfo

WIP!

Tries to fix #6634. I also compared the methods with the changes done in the upstream ZF (where also some fixes happened).