fix bug due to Python's SIGCHLD sometimes has delay