Make rm_rf more robust on Windows

There are several issues with shutil.rmtree, especially on NFS volumes, that
are usually resolved by trying again. This is a similar fix from
https://github.com/hashdist/hashdist/pull/116.

Fixes #850.
max_retries should be 0 on Unix