jobd: properly handle SIGINT and SIGTERM