Issue #21905: Avoid RuntimeError in pickle.whichmodule() when sys.modules is mutated while iterating.

Patch by Olivier Grisel.
#11866: Eliminate race condition in the computation of names for new threads.

Original patch by Peter Saveliev.
#14201: Update ctypes docs to match behavior changed from 214b28d7a999.

Original patch by Erik Johansson, slightly updated by Meador Inge.