asyncproc: check for valid previous signal handler before reinstating it

If the previous signal handler was not installed from Python, a value of
`None` is returned by `signal.signal`. This occurs when Python calls the
destructors during system exit.

Fixes #27