Added sleep() workaround for windows php rename bug

For more info see links in issue #8766