[2.7] bpo-30057: Fix potential missed signal in signal.signal(). (GH-4258) (#4263)

Bug report and patch by Jeroen Demeyer..
(cherry picked from commit f6f90ff079a22b79a58d47b6117cc8a8c7d366f3)
3 files changed