Teach res_file/dir to replace symlinks

If you specify a file resource that already exists on the local host as
a file, the existing file gets overwritten.  Now, if the target exists
as a symlink, the link will be removed and replaced by the desired file.

Similary, a dir resource will remove target symlinks and replace them
with directories.