minimize use of strncmp in rev_pack_files

Atomize and cache master directory names to avoid multiple strrchr
and strncmp calls.

This made for a small speedup in emacs sized repos.

The merge phase of netbsd-pkgsrc went from ~3050s to ~1950s. The
total repo conversion was under an hour for the first time. (57m30s)
Fix regressions
Some improvements to error message direction and logging.

Partial rescure of a patch by Laurewence Hygate that didn't apply clean.

Regression tests pass.
Notes from getting make check working on Cygwin

If you have a folder called CVSROOT in any parent directory
then cvs won't create a repository in the sub directory.

Cygwin's cvs -Q is suprisingly noisy for some commands

Missing dependency in Makefile
Rename some parts of toposort for clarity