fix infinite loop in logging when the logged process dies