Instead of copying data from a CMutableTransaction into a CTransaction,
the data is temporarily moved and then moved back after it’s use. This speeds up
the slowest unit test transaction_tests/test_big_witness_transaction:
24.351 sec for all unit tests before 21.187 sec for all unit tests after this change
The change is somewhat ugly since a const_cast is necessary.
Relates to  #10026. It should also speed up any use of SignSignature, especially for machines where  allocating memory is slow.