This fixes a subtle bug involving block re-orgs and non-standard transactions.
Start with a block containing a non-standard transaction, and one or more transactions spending it in the memory pool.
Then re-org away from that block to another chain that does not contain the non-standard transaction.
Result before this fix: the dependent transactions get stuck in the mempool without their parent, putting the mempool in an inconsistent state.
Tested with a new unit test.
Thanks to Alex Morcos for finding the bug.