bpo-42160: tempfile: Reduce overhead of pid check. (GH-22997)

The _RandomSequence class in tempfile used to check the current pid every time its rng property was used.
This commit replaces this code with `os.register_at_fork` to reduce the overhead.
3 files changed