[#2514] Delete read only files on Windows.

Problem
=======

If a file is read only on Windows, it can not be removed.

Changes
=======

Update deleteFile to remove read-only attribute before deleting the file.
I have also created a test for renameFile ... just in case there are errors there.

How to test
=========

reviewers: @alibotean 

check that changes make sense.
I have released this version so that we can use it in server.

thanks!