Make the files mapper recursively

This resolves issues on windows, when a parent folder had an index in the past
but the conflicting folder has been removed. Previous to this patch this would
cause a mess on the MappedStorage, since new children are not added to the
correct folder anymore.

Now the method is build recursively, so it correctly uses the parent physical
path instead of trying to recalculate it.

Fix #11103

@th3fallen @DeepDiver1975 @rperezb @icewind1991 @jnfrmarks
This was for my first try to write tests for this.
It's kind of hard to test private functions, while you can easily create a wrapper for protected ones