[policy] detect unsorted packages
Summary:
Quit early if a package is not topologically sorted, so if we later get a missing-inputs status we know that it is caused by an orphan tx or a tx trying to spend non-existing coins.
This concludes backport of core#20833
https://github.com/bitcoin/bitcoin/pull/20833/commits/13650fe2e527bf0cf5d977bf5f3f1563b853ecdc
Depends on D12126
Test Plan: ninja all check-all
Reviewers: #bitcoin_abc, Fabien
Reviewed By: #bitcoin_abc, Fabien
Subscribers: Fabien
Differential Revision: https://reviews.bitcoinabc.org/D12133