Fix search of parent directory in python script

Modify function `_PathsToAllParentFolders` to be compatible with
Windows filesystem.
Fix problem with function `_PathsToAllParentFolders` which does not
handle Windows system drive in the file path properly.