Only chdir in rebase-update if there's a directory to go back to.
Only chdir in rebase-update if there's a directory to go back to.

TBR=agable@chromium.org
BUG=499031

Review URL: https://codereview.chromium.org/1182713002

git-svn-id: bd64dd6fa6f3f0ed0c0666d1018379882b742947@295642 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

svn2github/chromium-depot-tools,svn2github/chromium-depot-tools,svn2github/chromium-depot-tools