klogd: fix the problem of delayed handling of ^C and SIGTERM