[backport#16363] test: Properly serialize BIP34 coinbase height
Summary:
In addition to the original commit, I had to add from .script import OP_1, which was skipped in our backport of PR11796 (D5750)
Partial backport of PR16363
Commit 77770d95e2838d7665fa8f621e9e83d79f9b3196
Test Plan: ninja && ninja check-functional
Reviewers: O1 Bitcoin ABC, #bitcoin_abc, deadalnix
Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, deadalnix
Subscribers: deadalnix
Differential Revision: https://reviews.bitcoinabc.org/D7901