Fixed undetected working directory in root directory (the additional "dir.rfind" in the while condition stopped the loop when e.g. "C:" has been reached)
Fixed performance issue when executing IsValidGitDir on an UNC path (now we stop when reaching the root directory (provided by GetVolumePathName), like "\\server\share")