This requires the removal of some very liberal (incorrect) cs_mains
sprinkled in some tests. It adds some chainActive.Tip() races, but
the tests are all single-threaded anyway.
Depends on D2607 and D2617
Partial backport of core PR11824 (commit a99b76f)