[3.13] gh-126316: Make grp.getgrall() thread-safe: add a mutex (#127055) (#127104)

* gh-126316: Make grp.getgrall() thread-safe: add a mutex (#127055)

grpmodule.c is no longer built with the limited C API, since PyMutex
is excluded from the limited C API.

(cherry picked from commit 3c2bd66e21bd8de69a89ebf09ff9d8e78ddfb839)

* Revert ABI changes

Don't use Argument Clinic for grp.getgrgid() to avoid changing the
ABI (change PyInterpreterState structure by adding an "id"
identifier).
4 files changed