functions: fix overwriting of symlinks with regular files
Use cp --remove-destination
in add_file
to remove the destination
file. Without this, if the destination file is an existing symlink, it
will be the link target that will get overwritten, not the symlink.