Chdir to tempdir to prevent permissions problems.
Merge pull request #2995 from SirScott/pip-sudo-user

pip module -- sudo_user permission problem fix