Rename "dir" variables

The variable name "dir" conflicts with the name of a Python built-in
function: http://docs.python.org/library/functions.html#dir

Change-Id: I850f3ec8df7563dc85e21f2876fe5e6550ca2d8f
diff --git a/subcmds/sync.py b/subcmds/sync.py
index 1b71635..e68a025 100644
--- a/subcmds/sync.py
+++ b/subcmds/sync.py
@@ -339,13 +339,13 @@
                 print >>sys.stderr, 'Deleting obsolete path %s' % project.worktree
                 shutil.rmtree(project.worktree)
                 # Try deleting parent subdirs if they are empty
-                dir = os.path.dirname(project.worktree)
-                while dir != self.manifest.topdir:
+                project_dir = os.path.dirname(project.worktree)
+                while project_dir != self.manifest.topdir:
                   try:
-                    os.rmdir(dir)
+                    os.rmdir(project_dir)
                   except OSError:
                     break
-                  dir = os.path.dirname(dir)
+                  project_dir = os.path.dirname(project_dir)
 
     new_project_paths.sort()
     fd = open(file_path, 'w')