test: Properly deserialize integers in little-endian
Summary:
This fixes a bug in a functional test. The bug was detected after Core started running CI tests for a big endian platform (see PR17591 and PR17599).
This is a partial backport of Core PR17599
https://github.com/bitcoin/bitcoin/pull/17599/commits/fad9fdbea5dfb19328282afda9588edc6f1d0ddf
Test Plan: ninja && test/functional/test_runner.py interface_rest
Reviewers: O1 Bitcoin ABC, #bitcoin_abc, deadalnix
Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, deadalnix
Differential Revision: https://reviews.bitcoinabc.org/D8283