Fix JENKINS-20770

Used a local variable for the expanded presend script instead of
reassigning to the original variable