Fix for JENKINS-15331

Retries file/directory deletes multiple times with a small delay between
failed attempts.