cf-dc-api.pl: clean filenames in case they have trailing newlines