Avoid repeated lookups in mapOrphanTransactions and mapOrphanTransactionsByPrev

Rebased-From: 89d91f6
Rebased-By: Wladimir J. van der Laan <laanwj@gmail.com>
Fix crashing bug caused by orphan(s) with duplicate prevout.hash

Rebased-From: def2fdb
Rebased-By: Wladimir J. van der Laan
Merge pull request #707 from rnicoll/1.8.1-dup-orphan

Avoid repeated lookups in mapOrphanTransactions and mapOrphanTransactionsByPrev