Fixes issues with deleting files and cleanup on windows.

Why do you believe we need sleeps in our code?  Which test fails without this?