py: check existence before creating a new directory
py: check existence before creating a new directory

If the name ends with '/', check if the tmp directory already exists
before trying to create it. Previously, it would result in an OSError
exception being thrown.

Signed-off-by: Andreas Tolfsen <dab4293f93c7233f547c2dcfbe48efb5ac3ee2f4@mozilla.com>

houchj/selenium,joshbruning/selenium,denis-vilyuzhanin/selenium-fastview,rplevka/selenium,p0deje/selenium,lukeis/selenium,krosenvold/selenium,dandv/selenium,5hawnknight/selenium,joshbruning/selenium,blueyed/selenium,gabrielsimas/selenium,vveliev/selenium,sri85/selenium,lrowe/selenium,chrisblock/selenium,Appdynamics/selenium,sankha93/selenium,alexec/selenium,vveliev/selenium,MCGallaspy/selenium,doungni/selenium,markodolancic/selenium,petruc/selenium,TikhomirovSergey/selenium,Tom-Trumper/selenium,asolntsev/selenium,gotcha/selenium,jabbrwcky/selenium,Jarob22/selenium,knorrium/selenium,titusfortner/selenium,5hawnknight/selenium,gotcha/selenium,sag-enorman/selenium,krosenvold/selenium,yukaReal/selenium,anshumanchatterji/selenium,lilredindy/selenium,HtmlUnit/selenium,jabbrwcky/selenium,oddui/selenium,arunsingh/selenium,jsakamoto/selenium,yukaReal/selenium,joshuaduffy/selenium,krmahadevan/selenium,sri85/selenium,actmd/selenium,blackboarddd/selenium,HtmlUnit/selenium,Herst/selenium,HtmlUnit/selenium,tbeadle/selenium,uchida/selenium,twalpole/selenium,gabrielsimas/selenium,blueyed/selenium,lmtierney/selenium,gorlemik/selenium,Ardesco/selenium,houchj/selenium,petruc/selenium,bmannix/selenium,soundcloud/selenium,mach6/selenium,JosephCastro/selenium,quoideneuf/selenium,rplevka/selenium,petruc/selenium,uchida/selenium,TikhomirovSergey/selenium,JosephCastro/selenium,Jarob22/selenium,twalpole/selenium,Appdynamics/selenium,JosephCastro/selenium,jerome-jacob/selenium,dimacus/selenium,Sravyaksr/selenium,gotcha/selenium,lukeis/selenium,dimacus/selenium,krosenvold/selenium,vveliev/selenium,o-schneider/selenium,stupidnetizen/selenium,tkurnosova/selenium,p0deje/selenium,mestihudson/selenium,gregerrag/selenium,jsakamoto/selenium,tarlabs/selenium,gorlemik/selenium,wambat/selenium,carlosroh/selenium,thanhpete/selenium,rovner/selenium,yukaReal/selenium,sankha93/selenium,lilredindy/selenium,tkurnosova/selenium,dcjohnson1989/selenium,gabrielsimas/selenium,dcjohnson1989/selenium,dcjohnson1989/selenium,gotcha/selenium,TheBlackTuxCorp/selenium,chrisblock/selenium,denis-vilyuzhanin/selenium-fastview,meksh/selenium,davehunt/selenium,houchj/selenium,s2oBCN/selenium,Sravyaksr/selenium,Jarob22/selenium,stupidnetizen/selenium,tarlabs/selenium,petruc/selenium,o-schneider/selenium,houchj/selenium,BlackSmith/selenium,markodolancic/selenium,mestihudson/selenium,yukaReal/selenium,minhthuanit/selenium,actmd/selenium,slongwang/selenium,knorrium/selenium,juangj/selenium,MeetMe/selenium,markodolancic/selenium,o-schneider/selenium,quoideneuf/selenium,soundcloud/selenium,juangj/selenium,sevaseva/selenium,meksh/selenium,amikey/selenium,Dude-X/selenium,mojwang/selenium,gemini-testing/selenium,krosenvold/selenium,rplevka/selenium,s2oBCN/selenium,Dude-X/selenium,uchida/selenium,sankha93/selenium,xmhubj/selenium,rrussell39/selenium,alexec/selenium,joshmgrant/selenium,dimacus/selenium,gemini-testing/selenium,dimacus/selenium,DrMarcII/selenium,chrisblock/selenium,Tom-Trumper/selenium,amar-sharma/selenium,SeleniumHQ/selenium,actmd/selenium,sankha93/selenium,alexec/selenium,gregerrag/selenium,asolntsev/selenium,eric-stanley/selenium,blueyed/selenium,knorrium/selenium,soundcloud/selenium,mach6/selenium,amar-sharma/selenium,5hawnknight/selenium,5hawnknight/selenium,alexec/selenium,rovner/selenium,zenefits/selenium,gorlemik/selenium,sri85/selenium,amikey/selenium,tbeadle/selenium,p0deje/selenium,valfirst/selenium,SouWilliams/selenium,sankha93/selenium,vveliev/selenium,lmtierney/selenium,mojwang/selenium,bayandin/selenium,doungni/selenium,bmannix/selenium,DrMarcII/selenium,dbo/selenium,petruc/selenium,mojwang/selenium,thanhpete/selenium,MeetMe/selenium,carsonmcdonald/selenium,asolntsev/selenium,soundcloud/selenium,clavery/selenium,minhthuanit/selenium,denis-vilyuzhanin/selenium-fastview,s2oBCN/selenium,mojwang/selenium,sri85/selenium,oddui/selenium,markodolancic/selenium,houchj/selenium,dibagga/selenium,sri85/selenium,skurochkin/selenium,davehunt/selenium,tkurnosova/selenium,eric-stanley/selenium,dbo/selenium,soundcloud/selenium,rovner/selenium,meksh/selenium,titusfortner/selenium,sankha93/selenium,vveliev/selenium,amar-sharma/selenium,tbeadle/selenium,anshumanchatterji/selenium,carlosroh/selenium,dimacus/selenium,AutomatedTester/selenium,zenefits/selenium,BlackSmith/selenium,GorK-ChO/selenium,asolntsev/selenium,mestihudson/selenium,xsyntrex/selenium,dibagga/selenium,mojwang/selenium,Ardesco/selenium,joshbruning/selenium,chrisblock/selenium,jabbrwcky/selenium,AutomatedTester/selenium,i17c/selenium,blackboarddd/selenium,vveliev/selenium,clavery/selenium,s2oBCN/selenium,mach6/selenium,davehunt/selenium,denis-vilyuzhanin/selenium-fastview,quoideneuf/selenium,gurayinan/selenium,krosenvold/selenium,GorK-ChO/selenium,JosephCastro/selenium,oddui/selenium,davehunt/selenium,stupidnetizen/selenium,juangj/selenium,yukaReal/selenium,gotcha/selenium,lilredindy/selenium,bmannix/selenium,carlosroh/selenium,tarlabs/selenium,amar-sharma/selenium,knorrium/selenium,jsakamoto/selenium,Ardesco/selenium,MCGallaspy/selenium,Ardesco/selenium,lrowe/selenium,gemini-testing/selenium,dandv/selenium,slongwang/selenium,denis-vilyuzhanin/selenium-fastview,juangj/selenium,quoideneuf/selenium,TheBlackTuxCorp/selenium,joshuaduffy/selenium,minhthuanit/selenium,anshumanchatterji/selenium,amar-sharma/selenium,oddui/selenium,chrisblock/selenium,gorlemik/selenium,asashour/selenium,Sravyaksr/selenium,alb-i986/selenium,blackboarddd/selenium,i17c/selenium,MCGallaspy/selenium,SeleniumHQ/selenium,GorK-ChO/selenium,valfirst/selenium,sevaseva/selenium,rrussell39/selenium,bartolkaruza/selenium,jsakamoto/selenium,rovner/selenium,blackboarddd/selenium,asolntsev/selenium,davehunt/selenium,Ardesco/selenium,knorrium/selenium,chrisblock/selenium,krosenvold/selenium,valfirst/selenium,valfirst/selenium,TikhomirovSergey/selenium,i17c/selenium,o-schneider/selenium,gemini-testing/selenium,alb-i986/selenium,minhthuanit/selenium,rplevka/selenium,slongwang/selenium,doungni/selenium,skurochkin/selenium,gabrielsimas/selenium,tkurnosova/selenium,carsonmcdonald/selenium,SeleniumHQ/selenium,mach6/selenium,HtmlUnit/selenium,eric-stanley/selenium,5hawnknight/selenium,mach6/selenium,sevaseva/selenium,rovner/selenium,bayandin/selenium,p0deje/selenium,gregerrag/selenium,titusfortner/selenium,sag-enorman/selenium,clavery/selenium,Herst/selenium,rovner/selenium,MCGallaspy/selenium,asashour/selenium,davehunt/selenium,uchida/selenium,minhthuanit/selenium,i17c/selenium,lrowe/selenium,blueyed/selenium,gotcha/selenium,carsonmcdonald/selenium,SouWilliams/selenium,Herst/selenium,AutomatedTester/selenium,Dude-X/selenium,Dude-X/selenium,joshuaduffy/selenium,jabbrwcky/selenium,SouWilliams/selenium,gemini-testing/selenium,dimacus/selenium,gorlemik/selenium,xsyntrex/selenium,gurayinan/selenium,minhthuanit/selenium,dibagga/selenium,joshmgrant/selenium,sri85/selenium,joshbruning/selenium,vveliev/selenium,s2oBCN/selenium,knorrium/selenium,uchida/selenium,slongwang/selenium,gabrielsimas/selenium,dibagga/selenium,houchj/selenium,wambat/selenium,gorlemik/selenium,joshmgrant/selenium,joshmgrant/selenium,dcjohnson1989/selenium,customcommander/selenium,alb-i986/selenium,actmd/selenium,Sravyaksr/selenium,lmtierney/selenium,dandv/selenium,5hawnknight/selenium,Dude-X/selenium,alb-i986/selenium,twalpole/selenium,bartolkaruza/selenium,xsyntrex/selenium,thanhpete/selenium,SouWilliams/selenium,o-schneider/selenium,stupidnetizen/selenium,DrMarcII/selenium,sri85/selenium,lmtierney/selenium,BlackSmith/selenium,bmannix/selenium,TheBlackTuxCorp/selenium,dandv/selenium,markodolancic/selenium,slongwang/selenium,asashour/selenium,AutomatedTester/selenium,SouWilliams/selenium,zenefits/selenium,titusfortner/selenium,dibagga/selenium,thanhpete/selenium,DrMarcII/selenium,Tom-Trumper/selenium,sevaseva/selenium,blackboarddd/selenium,quoideneuf/selenium,dbo/selenium,Herst/selenium,mach6/selenium,kalyanjvn1/selenium,SouWilliams/selenium,soundcloud/selenium,BlackSmith/selenium,5hawnknight/selenium,o-schneider/selenium,lukeis/selenium,xmhubj/selenium,alexec/selenium,carlosroh/selenium,clavery/selenium,eric-stanley/selenium,tkurnosova/selenium,anshumanchatterji/selenium,arunsingh/selenium,juangj/selenium,bartolkaruza/selenium,asashour/selenium,Herst/selenium,twalpole/selenium,Ardesco/selenium,tarlabs/selenium,MeetMe/selenium,dandv/selenium,jerome-jacob/selenium,rrussell39/selenium,gorlemik/selenium,lukeis/selenium,dcjohnson1989/selenium,tkurnosova/selenium,amikey/selenium,TheBlackTuxCorp/selenium,customcommander/selenium,zenefits/selenium,bayandin/selenium,gorlemik/selenium,bayandin/selenium,yukaReal/selenium,BlackSmith/selenium,stupidnetizen/selenium,asashour/selenium,alb-i986/selenium,sag-enorman/selenium,MeetMe/selenium,customcommander/selenium,asolntsev/selenium,5hawnknight/selenium,gabrielsimas/selenium,arunsingh/selenium,tbeadle/selenium,dbo/selenium,jabbrwcky/selenium,actmd/selenium,HtmlUnit/selenium,gregerrag/selenium,chrisblock/selenium,o-schneider/selenium,doungni/selenium,jsakamoto/selenium,chrisblock/selenium,joshuaduffy/selenium,jsakamoto/selenium,rrussell39/selenium,knorrium/selenium,blueyed/selenium,thanhpete/selenium,anshumanchatterji/selenium,soundcloud/selenium,HtmlUnit/selenium,twalpole/selenium,thanhpete/selenium,tbeadle/selenium,clavery/selenium,HtmlUnit/selenium,joshmgrant/selenium,blueyed/selenium,o-schneider/selenium,amar-sharma/selenium,bmannix/selenium,Tom-Trumper/selenium,arunsingh/selenium,bayandin/selenium,p0deje/selenium,clavery/selenium,juangj/selenium,xmhubj/selenium,gemini-testing/selenium,carlosroh/selenium,joshbruning/selenium,minhthuanit/selenium,i17c/selenium,carsonmcdonald/selenium,TikhomirovSergey/selenium,JosephCastro/selenium,lilredindy/selenium,MCGallaspy/selenium,TikhomirovSergey/selenium,soundcloud/selenium,Ardesco/selenium,petruc/selenium,mestihudson/selenium,xsyntrex/selenium,meksh/selenium,eric-stanley/selenium,blueyed/selenium,juangj/selenium,o-schneider/selenium,bmannix/selenium,tbeadle/selenium,JosephCastro/selenium,jerome-jacob/selenium,dimacus/selenium,denis-vilyuzhanin/selenium-fastview,stupidnetizen/selenium,dibagga/selenium,HtmlUnit/selenium,mach6/selenium,doungni/selenium,Herst/selenium,davehunt/selenium,joshmgrant/selenium,5hawnknight/selenium,bartolkaruza/selenium,jabbrwcky/selenium,gotcha/selenium,blackboarddd/selenium,Appdynamics/selenium,bayandin/selenium,DrMarcII/selenium,alexec/selenium,clavery/selenium,arunsingh/selenium,p0deje/selenium,dandv/selenium,AutomatedTester/selenium,bartolkaruza/selenium,customcommander/selenium,dbo/selenium,anshumanchatterji/selenium,gemini-testing/selenium,kalyanjvn1/selenium,denis-vilyuzhanin/selenium-fastview,carsonmcdonald/selenium,Jarob22/selenium,carsonmcdonald/selenium,yukaReal/selenium,krmahadevan/selenium,GorK-ChO/selenium,asashour/selenium,TheBlackTuxCorp/selenium,bartolkaruza/selenium,kalyanjvn1/selenium,TheBlackTuxCorp/selenium,SouWilliams/selenium,blackboarddd/selenium,sri85/selenium,krmahadevan/selenium,bmannix/selenium,valfirst/selenium,sankha93/selenium,uchida/selenium,meksh/selenium,stupidnetizen/selenium,i17c/selenium,sankha93/selenium,mestihudson/selenium,carlosroh/selenium,Tom-Trumper/selenium,MCGallaspy/selenium,dcjohnson1989/selenium,thanhpete/selenium,zenefits/selenium,DrMarcII/selenium,wambat/selenium,krmahadevan/selenium,Jarob22/selenium,joshmgrant/selenium,lukeis/selenium,SeleniumHQ/selenium,carsonmcdonald/selenium,SouWilliams/selenium,sag-enorman/selenium,mestihudson/selenium,markodolancic/selenium,sag-enorman/selenium,tarlabs/selenium,yukaReal/selenium,asolntsev/selenium,tarlabs/selenium,slongwang/selenium,amikey/selenium,AutomatedTester/selenium,skurochkin/selenium,mestihudson/selenium,rovner/selenium,bayandin/selenium,SouWilliams/selenium,Sravyaksr/selenium,AutomatedTester/selenium,Ardesco/selenium,wambat/selenium,Tom-Trumper/selenium,lrowe/selenium,TikhomirovSergey/selenium,gurayinan/selenium,DrMarcII/selenium,dkentw/selenium,sag-enorman/selenium,clavery/selenium,Tom-Trumper/selenium,gemini-testing/selenium,titusfortner/selenium,juangj/selenium,valfirst/selenium,houchj/selenium,gregerrag/selenium,xsyntrex/selenium,houchj/selenium,denis-vilyuzhanin/selenium-fastview,krosenvold/selenium,asolntsev/selenium,lilredindy/selenium,gurayinan/selenium,Appdynamics/selenium,davehunt/selenium,rplevka/selenium,p0deje/selenium,Tom-Trumper/selenium,petruc/selenium,Sravyaksr/selenium,dandv/selenium,blueyed/selenium,juangj/selenium,alb-i986/selenium,quoideneuf/selenium,mojwang/selenium,GorK-ChO/selenium,joshuaduffy/selenium,TheBlackTuxCorp/selenium,zenefits/selenium,customcommander/selenium,xsyntrex/selenium,clavery/selenium,dbo/selenium,dandv/selenium,wambat/selenium,mestihudson/selenium,gurayinan/selenium,gurayinan/selenium,gregerrag/selenium,joshmgrant/selenium,Appdynamics/selenium,joshmgrant/selenium,petruc/selenium,uchida/selenium,customcommander/selenium,amar-sharma/selenium,markodolancic/selenium,jsakamoto/selenium,Dude-X/selenium,sevaseva/selenium,tbeadle/selenium,sevaseva/selenium,minhthuanit/selenium,gregerrag/selenium,TikhomirovSergey/selenium,kalyanjvn1/selenium,Sravyaksr/selenium,gorlemik/selenium,Herst/selenium,tbeadle/selenium,bartolkaruza/selenium,vveliev/selenium,s2oBCN/selenium,blackboarddd/selenium,yukaReal/selenium,xmhubj/selenium,jabbrwcky/selenium,minhthuanit/selenium,DrMarcII/selenium,dcjohnson1989/selenium,lilredindy/selenium,davehunt/selenium,chrisblock/selenium,markodolancic/selenium,DrMarcII/selenium,BlackSmith/selenium,tbeadle/selenium,lmtierney/selenium,jerome-jacob/selenium,oddui/selenium,joshbruning/selenium,uchida/selenium,Jarob22/selenium,rplevka/selenium,gotcha/selenium,krmahadevan/selenium,dimacus/selenium,MeetMe/selenium,alb-i986/selenium,tkurnosova/selenium,Herst/selenium,dkentw/selenium,MeetMe/selenium,valfirst/selenium,bmannix/selenium,quoideneuf/selenium,SeleniumHQ/selenium,customcommander/selenium,skurochkin/selenium,kalyanjvn1/selenium,skurochkin/selenium,doungni/selenium,actmd/selenium,s2oBCN/selenium,skurochkin/selenium,lrowe/selenium,dibagga/selenium,knorrium/selenium,asashour/selenium,lrowe/selenium,joshuaduffy/selenium,SeleniumHQ/selenium,asashour/selenium,tarlabs/selenium,dibagga/selenium,SeleniumHQ/selenium,gotcha/selenium,arunsingh/selenium,Jarob22/selenium,carlosroh/selenium,alexec/selenium,amikey/selenium,knorrium/selenium,actmd/selenium,Jarob22/selenium,oddui/selenium,alexec/selenium,joshuaduffy/selenium,bayandin/selenium,rrussell39/selenium,dkentw/selenium,rrussell39/selenium,p0deje/selenium,anshumanchatterji/selenium,amar-sharma/selenium,zenefits/selenium,Dude-X/selenium,anshumanchatterji/selenium,arunsingh/selenium,amar-sharma/selenium,dibagga/selenium,gabrielsimas/selenium,jabbrwcky/selenium,dimacus/selenium,rovner/selenium,TikhomirovSergey/selenium,lukeis/selenium,jerome-jacob/selenium,MeetMe/selenium,twalpole/selenium,petruc/selenium,Herst/selenium,xsyntrex/selenium,slongwang/selenium,carlosroh/selenium,SeleniumHQ/selenium,bayandin/selenium,joshbruning/selenium,lrowe/selenium,valfirst/selenium,mach6/selenium,TheBlackTuxCorp/selenium,krosenvold/selenium,arunsingh/selenium,customcommander/selenium,denis-vilyuzhanin/selenium-fastview,sankha93/selenium,actmd/selenium,eric-stanley/selenium,bartolkaruza/selenium,kalyanjvn1/selenium,dkentw/selenium,oddui/selenium,meksh/selenium,JosephCastro/selenium,lmtierney/selenium,titusfortner/selenium,titusfortner/selenium,Jarob22/selenium,rovner/selenium,kalyanjvn1/selenium,uchida/selenium,xsyntrex/selenium,eric-stanley/selenium,jabbrwcky/selenium,krosenvold/selenium,dkentw/selenium,oddui/selenium,rrussell39/selenium,joshuaduffy/selenium,jsakamoto/selenium,dbo/selenium,asolntsev/selenium,carsonmcdonald/selenium,mojwang/selenium,dcjohnson1989/selenium,BlackSmith/selenium,Dude-X/selenium,gurayinan/selenium,joshbruning/selenium,soundcloud/selenium,bartolkaruza/selenium,AutomatedTester/selenium,thanhpete/selenium,sevaseva/selenium,mach6/selenium,jerome-jacob/selenium,Appdynamics/selenium,twalpole/selenium,actmd/selenium,joshuaduffy/selenium,MCGallaspy/selenium,HtmlUnit/selenium,JosephCastro/selenium,xsyntrex/selenium,wambat/selenium,jerome-jacob/selenium,tarlabs/selenium,amikey/selenium,krmahadevan/selenium,vveliev/selenium,rplevka/selenium,carsonmcdonald/selenium,TheBlackTuxCorp/selenium,thanhpete/selenium,dbo/selenium,Appdynamics/selenium,GorK-ChO/selenium,wambat/selenium,GorK-ChO/selenium,tkurnosova/selenium,quoideneuf/selenium,xmhubj/selenium,doungni/selenium,meksh/selenium,twalpole/selenium,TikhomirovSergey/selenium,p0deje/selenium,sevaseva/selenium,blueyed/selenium,BlackSmith/selenium,valfirst/selenium,Ardesco/selenium,zenefits/selenium,gregerrag/selenium,blackboarddd/selenium,i17c/selenium,valfirst/selenium,markodolancic/selenium,SeleniumHQ/selenium,krmahadevan/selenium,BlackSmith/selenium,MCGallaspy/selenium,titusfortner/selenium,gemini-testing/selenium,JosephCastro/selenium,sevaseva/selenium,sag-enorman/selenium,dkentw/selenium,AutomatedTester/selenium,dandv/selenium,Appdynamics/selenium,jsakamoto/selenium,krmahadevan/selenium,GorK-ChO/selenium,i17c/selenium,MeetMe/selenium,dkentw/selenium,asashour/selenium,lrowe/selenium,dkentw/selenium,anshumanchatterji/selenium,kalyanjvn1/selenium,amikey/selenium,rrussell39/selenium,xmhubj/selenium,oddui/selenium,quoideneuf/selenium,wambat/selenium,lilredindy/selenium,skurochkin/selenium,zenefits/selenium,tkurnosova/selenium,i17c/selenium,gurayinan/selenium,stupidnetizen/selenium,joshbruning/selenium,houchj/selenium,meksh/selenium,lilredindy/selenium,joshmgrant/selenium,lmtierney/selenium,carlosroh/selenium,kalyanjvn1/selenium,tarlabs/selenium,jerome-jacob/selenium,xmhubj/selenium,lilredindy/selenium,dcjohnson1989/selenium,gurayinan/selenium,sag-enorman/selenium,Appdynamics/selenium,rrussell39/selenium,lukeis/selenium,wambat/selenium,rplevka/selenium,lmtierney/selenium,amikey/selenium,alb-i986/selenium,Sravyaksr/selenium,gregerrag/selenium,alexec/selenium,HtmlUnit/selenium,xmhubj/selenium,Sravyaksr/selenium,bmannix/selenium,eric-stanley/selenium,dkentw/selenium,titusfortner/selenium,dbo/selenium,Tom-Trumper/selenium,SeleniumHQ/selenium,mojwang/selenium,joshmgrant/selenium,mojwang/selenium,doungni/selenium,sri85/selenium,lukeis/selenium,slongwang/selenium,xmhubj/selenium,arunsingh/selenium,lmtierney/selenium,GorK-ChO/selenium,gabrielsimas/selenium,sag-enorman/selenium,jerome-jacob/selenium,rplevka/selenium,krmahadevan/selenium,alb-i986/selenium,MeetMe/selenium,s2oBCN/selenium,slongwang/selenium,skurochkin/selenium,skurochkin/selenium,lukeis/selenium,titusfortner/selenium,customcommander/selenium,s2oBCN/selenium,doungni/selenium,gabrielsimas/selenium,mestihudson/selenium,twalpole/selenium,valfirst/selenium,stupidnetizen/selenium,meksh/selenium,amikey/selenium,lrowe/selenium,SeleniumHQ/selenium,titusfortner/selenium,eric-stanley/selenium,Dude-X/selenium,MCGallaspy/selenium