close unused pipe fd in main process, stop if read from pipe failed