builder.py: fix potential race condition
builder.py: fix potential race condition

There is a possible TOCTOU race condition in the event that two
jenkins-jobs instances are running at the same time and try to create
the cache directory at the same time.

story: 2000374
Change-Id: Ie194eb7b52237356e8ab935aed97af577a96605b

grdryn/jenkins-job-builder,onshape/jenkins-job-builder,phinexus/jenkins-job-builder,wsoula/jenkins-job-builder,puppetlabs/jenkins-job-builder,david-caro/jenkins-job-builder,dataxu/jenkins-job-builder,theforeman/jenkins-job-builder,grdryn/jenkins-job-builder,mjeanson/jenkins-job-builder,wikimedia/integration-jenkins-job-builder,theforeman/jenkins-job-builder,rsig/jenkins-job-builder,tamac-io/jenkins-job-builder,simzacks/jjb,wsoula/jenkins-job-builder,rsig/jenkins-job-builder,rsig/jenkins-job-builder,onshape/jenkins-job-builder,linuxmaniac/jenkins-job-builder,twc-openstack/jenkins-job-builder,twc-openstack/jenkins-job-builder,klmitch/jenkins-job-builder,mjeanson/jenkins-job-builder,theforeman/jenkins-job-builder,wikimedia/integration-jenkins-job-builder,linuxmaniac/jenkins-job-builder,gforcada/jenkins-job-builder,OSSystems/jenkins-job-builder,joostvdg/jenkins-job-builder,tamac-io/jenkins-job-builder,tamac-io/jenkins-job-builder,david-caro/jenkins-job-builder,joostvdg/jenkins-job-builder,gforcada/jenkins-job-builder,phinexus/jenkins-job-builder,gforcada/jenkins-job-builder,klmitch/jenkins-job-builder,theforeman/jenkins-job-builder,simzacks/jjb,dataxu/jenkins-job-builder,simzacks/jjb,klmitch/jenkins-job-builder,joostvdg/jenkins-job-builder,mjeanson/jenkins-job-builder,lukas-bednar/jenkins-job-builder,tamac-io/jenkins-job-builder,puppetlabs/jenkins-job-builder,gforcada/jenkins-job-builder,lukas-bednar/jenkins-job-builder,klmitch/jenkins-job-builder,dataxu/jenkins-job-builder,puppetlabs/jenkins-job-builder,wikimedia/integration-jenkins-job-builder,gforcada/jenkins-job-builder,wsoula/jenkins-job-builder,twc-openstack/jenkins-job-builder,wsoula/jenkins-job-builder,linuxmaniac/jenkins-job-builder,phinexus/jenkins-job-builder,twc-openstack/jenkins-job-builder,wikimedia/integration-jenkins-job-builder,joostvdg/jenkins-job-builder,grdryn/jenkins-job-builder,rsig/jenkins-job-builder,dataxu/jenkins-job-builder,OSSystems/jenkins-job-builder,david-caro/jenkins-job-builder,OSSystems/jenkins-job-builder,phinexus/jenkins-job-builder,wikimedia/integration-jenkins-job-builder,simzacks/jjb,david-caro/jenkins-job-builder,lukas-bednar/jenkins-job-builder,phinexus/jenkins-job-builder,linuxmaniac/jenkins-job-builder,lukas-bednar/jenkins-job-builder,mjeanson/jenkins-job-builder,OSSystems/jenkins-job-builder,onshape/jenkins-job-builder,puppetlabs/jenkins-job-builder,onshape/jenkins-job-builder