retry waitpid when it is interrupted
fix bug in open_pipes