9fdf05d70cac4a62d1aeeb4299e2c3a9a866f8af (D3606) resolved some lock
inversion warnings in denialofservice_tests, but left in a number
of cs_main locks that are unnecessary (introducing lock inversion
warnings in future changes).
This is a backport of core#19533