Template upload: fix vsphere when broken build

Vsphere was stuck in infinite loop, and the upload could not continue. This solves that, and we are able to run the job in cron again.