ARROW-2070: [Python] Fix chdir logic in setup.py
ARROW-2070: [Python] Fix chdir logic in setup.py

In some conditions, setup.py may change the current directory and omit restoring the previous one, which can fail some operations.

Author: Antoine Pitrou <antoine@python.org>

Closes #1540 from pitrou/ARROW-2070-chdir-in-setuppy and squashes the following commits:

f043b681 [Antoine Pitrou] ARROW-2070: [Python] Fix chdir logic in setup.py

icexelloss/arrow,renesugar/arrow,laurentgo/arrow,pcmoritz/arrow,kou/arrow,xhochy/arrow,kou/arrow,dremio/arrow,kou/arrow,kou/arrow,wagavulin/arrow,icexelloss/arrow,yufeldman/arrow,icexelloss/arrow,renesugar/arrow,yufeldman/arrow,xhochy/arrow,siddharthteotia/arrow,pcmoritz/arrow,wagavulin/arrow,apache/arrow,apache/arrow,majetideepak/arrow,cpcloud/arrow,pcmoritz/arrow,wesm/arrow,wagavulin/arrow,siddharthteotia/arrow,dremio/arrow,laurentgo/arrow,dremio/arrow,wagavulin/arrow,laurentgo/arrow,pcmoritz/arrow,pcmoritz/arrow,xhochy/arrow,renesugar/arrow,pcmoritz/arrow,yufeldman/arrow,apache/arrow,xhochy/arrow,wagavulin/arrow,itaiin/arrow,cpcloud/arrow,wesm/arrow,kou/arrow,cpcloud/arrow,cpcloud/arrow,renesugar/arrow,majetideepak/arrow,icexelloss/arrow,apache/arrow,majetideepak/arrow,xhochy/arrow,kou/arrow,cpcloud/arrow,xhochy/arrow,itaiin/arrow,tebeka/arrow,wesm/arrow,yufeldman/arrow,majetideepak/arrow,cpcloud/arrow,pcmoritz/arrow,icexelloss/arrow,cpcloud/arrow,xhochy/arrow,icexelloss/arrow,apache/arrow,renesugar/arrow,itaiin/arrow,majetideepak/arrow,tebeka/arrow,wagavulin/arrow,siddharthteotia/arrow,itaiin/arrow,apache/arrow,laurentgo/arrow,majetideepak/arrow,laurentgo/arrow,yufeldman/arrow,kou/arrow,pcmoritz/arrow,majetideepak/arrow,icexelloss/arrow,dremio/arrow,dremio/arrow,itaiin/arrow,renesugar/arrow,pcmoritz/arrow,icexelloss/arrow,apache/arrow,icexelloss/arrow,wesm/arrow,icexelloss/arrow,itaiin/arrow,apache/arrow,laurentgo/arrow,majetideepak/arrow,pcmoritz/arrow,siddharthteotia/arrow,laurentgo/arrow,xhochy/arrow,xhochy/arrow,renesugar/arrow,cpcloud/arrow,wagavulin/arrow,wesm/arrow,pcmoritz/arrow,yufeldman/arrow,siddharthteotia/arrow,pcmoritz/arrow,itaiin/arrow,pcmoritz/arrow,itaiin/arrow,cpcloud/arrow,renesugar/arrow,renesugar/arrow,siddharthteotia/arrow,wagavulin/arrow,laurentgo/arrow,tebeka/arrow,kou/arrow,majetideepak/arrow,yufeldman/arrow,majetideepak/arrow,cpcloud/arrow,wesm/arrow,yufeldman/arrow,apache/arrow,tebeka/arrow,icexelloss/arrow,dremio/arrow,tebeka/arrow,cpcloud/arrow,icexelloss/arrow,renesugar/arrow,renesugar/arrow,wesm/arrow,majetideepak/arrow,tebeka/arrow,xhochy/arrow,itaiin/arrow,itaiin/arrow,siddharthteotia/arrow,kou/arrow,dremio/arrow,apache/arrow,renesugar/arrow,wesm/arrow,renesugar/arrow,yufeldman/arrow,dremio/arrow,wesm/arrow,kou/arrow,laurentgo/arrow,wesm/arrow,kou/arrow,apache/arrow,majetideepak/arrow,wagavulin/arrow,xhochy/arrow,wesm/arrow,laurentgo/arrow,wesm/arrow,itaiin/arrow,wesm/arrow,tebeka/arrow,dremio/arrow,xhochy/arrow,itaiin/arrow,yufeldman/arrow,laurentgo/arrow,xhochy/arrow,xhochy/arrow,cpcloud/arrow,wagavulin/arrow,kou/arrow,apache/arrow,wagavulin/arrow,icexelloss/arrow,siddharthteotia/arrow,siddharthteotia/arrow,tebeka/arrow,wagavulin/arrow,siddharthteotia/arrow,kou/arrow,itaiin/arrow,laurentgo/arrow,xhochy/arrow,itaiin/arrow,cpcloud/arrow,majetideepak/arrow,pcmoritz/arrow,cpcloud/arrow,tebeka/arrow,laurentgo/arrow,tebeka/arrow,icexelloss/arrow,apache/arrow,renesugar/arrow,yufeldman/arrow,kou/arrow,itaiin/arrow,wesm/arrow,apache/arrow,pcmoritz/arrow,majetideepak/arrow,renesugar/arrow,dremio/arrow,majetideepak/arrow,laurentgo/arrow,dremio/arrow,laurentgo/arrow,siddharthteotia/arrow