shlib.sh: add explicit INT and TERM traps
In order to clean up the $bang_log file we require the EXIT trap to
run. However, only bash arranges for EXIT to run when the shell is
killed by an uncaught signal.
Therefore install traps on both SIGINT and SIGTERM that just call
exit which causes the EXIT trap to run. POSIX specifies that the
exit code for a process killed by a signal is 128 + signal number,
so we use those exit codes to reflect that we exited because of a
signal.
This change combined with the previous change to jobd.pl to kill
timing out jobs with SIGTERM first should finally combine to
eliminate the accumulation of temporary files in /tmp as a result
of timing out jobs being killed.