Add cmp_mem test

Compares two memory areas and fails if the contents differ. The offset
of the first differing byte is reported.