Add raw transaction hex to `gettransaction` wallet RPC

This allows getting raw transaction data from the wallet even if the transaction is no longer in the blockchain / mempool (for example if it got orphaned due to malleability abuse).

Alternative to #3663