Errno::ECHILD is raised when there is no process with such PID, this is just workaround of the situation when the process is gone already, in such case we can finally read it from $?