improve rm_recursive for better windows support

I've updated rm_recursive to use rmdir when removing a folder in win32. I also added support for retrying the rmdir as a brute force fix.

Note that I haven't tested how rmdir behaves against symlinks created by git bash. It definitely behaves well against junctions created by cmd.