Backport fix for issue #18343

"Issue #18343: faulthandler.register() now keeps the previous signal
handler when the function is called twice, so faulthandler.unregister()
restores correctly the original signal handler."