Fix a bug in termhelpers: signal handlers can be integer (eg. SIG_IGN) instead of callable