Fix permission error when using easy_install through sudo

Same as b2542bff72d8b4f5adeec3e0bf6c14c64aaa7e18.
Merge pull request #5274 from veeti/easy_install_chdir

Fix permission error when using easy_install through sudo