syncpipe: consume from parent before closing child

Previously, closing the child side of the syncpipe (after fork) before reading from the parent would cause the parent to receive ECONNRESET. This meant that if `ReportChildError` was before `ReadFromParent`, the error would not be propagated to the parent.

Now `ReportChildError` will make it has already sync'd with the parent before writing the error.