Fix platform dependence on memcmp, which is sometimes broken