test: fix GIL subprocess test correctness (#6211)

* test: distinguish GIL deadlocks from subprocess startup and shutdown

Wait for explicit child-start and function-return signals so slow imports
or interpreter shutdown cannot masquerade as a blocked test. Replace the
intentional-deadlock special case with a dedicated GIL-only detector
control, and add regressions for delayed startup and shutdown.

Validation: CPython 3.14.4 focused GIL suite, 90 passed on regular Python;
72 passed and 18 skipped on free-threaded Python. Spawn checks and the
all-files pre-commit hooks passed. Both timing regressions fail when their
corresponding safeguards are removed.

* test: rename free-threaded skip marker to match its condition

Rename skipif_not_free_threaded to skipif_free_threaded so the name states
when pytest skips the test. The predicate and test behavior are unchanged.

Validation: all repository pre-commit hooks passed.

* test: check the internals count for every GIL operation pattern

* test: propagate exceptions from GIL test worker threads

* test: avoid semaphore finalizers in GIL subprocess tests

Replace the started/finished multiprocessing.Events with ordered messages
on a one-way pipe. Each Event allocates named semaphores under forkserver;
the per-case subprocess matrix can accumulate hundreds before PyPy garbage
collection, triggering reentrant resource_tracker cleanup in later tests.

Preserve separate startup, execution, and shutdown allowances. Keep the
parent writer open until child cleanup so EOF cannot masquerade as a phase
signal, and close all connection endpoints deterministically.

Add a regression that disables multiprocessing.Event and runs a real
subprocess successfully. It fails with the previous harness.

Validation: clean CPython 3.14.4 suites passed (1454 regular, 1438
free-threaded; Catch2 31 cases/1709 assertions each). Linux PyPy 3.11/8.0.1
full serial Python suite passed (1065 passed). Spawn checks and all
pre-commit hooks passed.
1 file changed