make symlink_unless_exists work with directories