Moved a dereference so the null check will be before the dereferencing
Summary: This is a backport of libsecp256k1 PR644
Test Plan:
ninja check-secp256k1
Reviewers: #bitcoin_abc, nakihito
Reviewed By: nakihito
Differential Revision: https://reviews.bitcoinabc.org/D5352