Bug: chmod should be called only if the tmp dir was created in the first...

... place

this bug was introduced here :
https://github.com/ansible/ansible/commit/f72f5a20df22c9231191d15502a606cef7f2f287#diff-af869caf5f6f46706dbf35970e39c686L319