Make rmtree() more robust

I noticed that on some clusters, if you watch the build log using `tail -f ...`, then it refuses to delete the tree. The previous loop was too quick to do anything about it, so now it has exponential increase in time, which give the user enough time to exit any `tail -f ...` sessions.