trapping SIGINT, SIGQUIT in asynchronous tasks