Exit with a non-zero status if the fork returns

There are some situations where the forked process will exit normally,
for example, if stdin is closed. Otherwise, an error has occurred.
Return the error condition to the parent.