[xbuild] Implement GetDirectoryNameOfFileAbove ()

The method looks for the given file starting at the given path and traverses the directory tree up until the file is found or root is reached.
You have the value in path variable, no need to extract it again