asyncproc: check if previous alarm was set before trying to restore it

If no previous alarm is set, signal.signal will return None instead of
the previous signal handler.

Fixes #27