Conditionally include signal_handler

The signal handler is not used unless we have specified maximum
run-time. This might result in a build error in case it's not defined.
Wrap the handler in an ifdef so that it's only built if it is needed.

Signed-off-by: Marcus Karlsson <mk@acc.umu.se>
Rename signal_handler to on_alarm

The signal handler is called when the alarm is triggered. It's not a
generic signal handler, so make it clear from the name that it handles
the alarm.

Signed-off-by: Marcus Karlsson <mk@acc.umu.se>