Stop mkdir output on each job write
Stop mkdir output on each job write

When JJB write jobs to an output directory, each job would attempt to
mkdir the output directory causing unneccessary system calls:

mkdir("output-parent", 0777)            = -1 EEXIST (File exists)
stat("output-parent", {st_mode=S_IFDIR|0755, ...}) = 0

Create the output directory before the write loop unless it the output
is writable (stdout) or it already exist. That should speed up the test
operation a little bit.

Change-Id: I17495cba51bd85e4a6f86491a992cec6a3024e72

OSSystems/jenkins-job-builder,puppetlabs/jenkins-job-builder,klmitch/jenkins-job-builder,gforcada/jenkins-job-builder,onshape/jenkins-job-builder,klmitch/jenkins-job-builder,twc-openstack/jenkins-job-builder,GoodgameStudios/jenkins-job-builder,vredchenko/jenkins-job-builder,GoodgameStudios/jenkins-job-builder,jenshnielsen/jenkins-job-builder,wikimedia/integration-jenkins-job-builder,partkyle/jenkins-job-builder,tamac-io/jenkins-job-builder,wsoula/jenkins-job-builder,maxandersen/jenkins-job-builder,pyatil/jenkins-job-builder,OSSystems/jenkins-job-builder,kei-yamazaki/jenkins-job-builder,lukas-bednar/jenkins-job-builder,wikimedia/integration-jenkins-job-builder,david-caro/jenkins-job-builder,linuxmaniac/jenkins-job-builder,pyatil/jenkins-job-builder,tya/jenkins-job-builder,dataxu/jenkins-job-builder,joostvdg/jenkins-job-builder,david-caro/jenkins-job-builder,gregsymons/jenkins-job-builder,sunyi00/jenkins-job-builder,carroarmato0/jenkins-job-builder,grdryn/jenkins-job-builder,wsoula/jenkins-job-builder,puppetlabs/jenkins-job-builder,theforeman/jenkins-job-builder,CruGlobal/jenkins-job-builder,carroarmato0/jenkins-job-builder,phinexus/jenkins-job-builder,electrical/jenkins-job-builder,onshape/jenkins-job-builder,phinexus/jenkins-job-builder,vredchenko/jenkins-job-builder,david-caro/jenkins-job-builder,pyatil/jenkins-job-builder,fuglu/jenkins-job-builder,blaffoy/jenkins-job-builder,partkyle/jenkins-job-builder,simzacks/jjb,jenshnielsen/jenkins-job-builder,OSSystems/jenkins-job-builder,phinexus/jenkins-job-builder,mohitsethi/jenkins-job-builder,fuglu/jenkins-job-builder,lukas-bednar/jenkins-job-builder,kei-yamazaki/jenkins-job-builder,linuxmaniac/jenkins-job-builder,rsig/jenkins-job-builder,maxandersen/jenkins-job-builder,joostvdg/jenkins-job-builder,stanchan/jenkins-job-builder,mjeanson/jenkins-job-builder,joostvdg/jenkins-job-builder,onshape/jenkins-job-builder,tamac-io/jenkins-job-builder,grdryn/jenkins-job-builder,madAndroid/jenkins-job-builder,jenshnielsen/jenkins-job-builder,twc-openstack/jenkins-job-builder,simzacks/jjb,electrical/jenkins-job-builder,grdryn/jenkins-job-builder,theforeman/jenkins-job-builder,sebbrandt87/jenkins-job-builder,sebbrandt87/jenkins-job-builder,klmitch/jenkins-job-builder,phinexus/jenkins-job-builder,linuxmaniac/jenkins-job-builder,dataxu/jenkins-job-builder,cyberious/jenkins-job-builder,linuxmaniac/jenkins-job-builder,kei-yamazaki/jenkins-job-builder,gforcada/jenkins-job-builder,dataxu/jenkins-job-builder,dataxu/jenkins-job-builder,gforcada/jenkins-job-builder,onshape/jenkins-job-builder,mjeanson/jenkins-job-builder,puppetlabs/jenkins-job-builder,mjeanson/jenkins-job-builder,twc-openstack/jenkins-job-builder,madAndroid/jenkins-job-builder,CruGlobal/jenkins-job-builder,lukas-bednar/jenkins-job-builder,gregsymons/jenkins-job-builder,tya/jenkins-job-builder,tya/jenkins-job-builder,rsig/jenkins-job-builder,tamac-io/jenkins-job-builder,rsig/jenkins-job-builder,gforcada/jenkins-job-builder,rsig/jenkins-job-builder,sebbrandt87/jenkins-job-builder,phinexus/jenkins-job-builder,sunyi00/jenkins-job-builder,theforeman/jenkins-job-builder,wsoula/jenkins-job-builder,madAndroid/jenkins-job-builder,joostvdg/jenkins-job-builder,OSSystems/jenkins-job-builder,wikimedia/integration-jenkins-job-builder,twc-openstack/jenkins-job-builder,gforcada/jenkins-job-builder,pyatil/jenkins-job-builder,partkyle/jenkins-job-builder,puppetlabs/jenkins-job-builder,klmitch/jenkins-job-builder,mohitsethi/jenkins-job-builder,electrical/jenkins-job-builder,wikimedia/integration-jenkins-job-builder,CruGlobal/jenkins-job-builder,cyberious/jenkins-job-builder,theforeman/jenkins-job-builder,carroarmato0/jenkins-job-builder,mjeanson/jenkins-job-builder,gregsymons/jenkins-job-builder,lukas-bednar/jenkins-job-builder,simzacks/jjb,david-caro/jenkins-job-builder,sunyi00/jenkins-job-builder,wikimedia/integration-jenkins-job-builder,cyberious/jenkins-job-builder,wsoula/jenkins-job-builder,GoodgameStudios/jenkins-job-builder,blaffoy/jenkins-job-builder,simzacks/jjb,stanchan/jenkins-job-builder,mohitsethi/jenkins-job-builder,tamac-io/jenkins-job-builder,stanchan/jenkins-job-builder,fuglu/jenkins-job-builder,vredchenko/jenkins-job-builder