pattern-lookup was not taking care of repeated pattern variables
correctly. It was looking for the pattern in the list of values!
Patched for now to assume that sharing is rare, and thus extra
work is done then.
To do handle this Correctly, pattern-variables should be modified to
replace each occurrence of a pattern variable with a pattern-variable
+ position, where position is false if this is the first occurrence of
the pattern variable or the index for list-ref of the previous value
if not. This avoids the runtime memq, etc.