JENKINS-26232 Make temporary directories configurable

Replaces https://github.com/jenkinsci/ec2-plugin/pull/115