__fish_print_packages: correct syntax for yum, improve yum/rpm pipelines

Closes #1269 (output to cache file).

Reworks the editing pipeline for both yum and rpm completions down to a
single sed command.