fix issue where getrawtransaction RPC call does not work

The RPC call `getrawtransaction` does not work with transactions (coinstake txs) in an orphaned block.

For example the following orphaned block can be fetched via the RPC
`getblock 45fb29047b0d93691029b5931bb78cba076c4ac9aa8310acd1620709f5582b60`
but the first transaction
`getrawtransaction dcb0597105107b8e9af2f851fc120a7ebc2ee544ac06c1689ea0f9aebfddc11e`
fails
`error: {"code":-5,"message":"No information available about transaction"}`

This patch solves the issue.
Credits go also to @sigmike for coming up with a solution for the NuBits client.