Only compute strlen if we use it

I suspect the compiler is smart enough to do this, but doesn't
reduce readibility to make it explicit.
Cache results of strncmp between directory names

Create master_dir as a separate struct use it to store name,
strlen(name) and a hash value of directories.

Add a master_dir reference to rev_master

Populate the master_dir, atomically so masters with the same
directory have the same reference.

Cache the results of checking whether one directory is an ancestor
of another.

NetBSD calls this check about 7,000,000,000 times, but with only
95,000 different parameters.
Squeeze a bit more performance from snapshotline

8% of the CPU time in snapshotline is spent maintaining the
chars_read variable. This can be calulated when needed instead.

Took snapshot generation (to /dev/null) in emacs from 73s to 68s
Reduce the oldhead repo to three commits. It still exhibits its bug.
Faster, pussycat! Kill! Kill!
Use a real merge join in compute_parent_links

The original code fooled me slightly, as it looks like a merge join
when profiling (i.e. it looks more like 2n iterations rather than n log n)
However, it is because children nearly always have parents.

Using a real merge join means we complete each iterator exactly once. The
original would complete each iterator once to compute the early exit.
condition and then iterate each again.

Puts emacs fast order save from 20s to 15s