Guard memcmp in tests against mixed size inputs.
Summary:
Reported by real-or-random.
Fixes #623.
This is a backport of secp256k1 PR627
Test Plan:
make check
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D4999