test-check: don't report distutils as a local import
On python 3.12 this is wrongly reported as a local import. So we adjust the
checker to avoid it.
Backed out changeset
f28c52a9f7b4
This backout and the previous are due to a large performance regression
detected in repositories with a lot of obsmarkers when performing a clone.
A better fix will come along at the start of the next cycle.