copyFile: try removing the target file before opening it for writing