wtxNew is committed to the wallet before the transactions it depends on
If bitcoind is killed after committing wtxNew but before committing the transaction it depends on the transaction could get stuck.
I'm thinking that should be rearranged such that the transaction wtxNew depends on are commited, wtxNew is committed, and finally the transaction outputs wtxNew uses are marked as spent.
This bug should be extremely rare on the main network since very few people are creating transaction which spend outputs that nobody else has heard of.
I'm not really sure about the proposed solution, criticism needed.