Restart waitpid if it returns with EINTR

In some situations waitpid() in kernel can be interrupted so it will retur retcode=-1,errno=EINTR *before* target process really exits. The suggested way is just restart waitpid().