Fix /dev/random problem: add initial value for status in waitpid()

It seems that if there's no child process terminated, waitpid won't set status.
This will cause problem when status=0 initially, which is the case on the server
Also explains why everything is ok locally, where initail value of status is some random number
make the logic of tle detect more reasonable

if waitpid returns 0 then stat should not be used
Merge pull request #2 from crccw/fix-tle-detect

Fix /dev/random problem: add initial value for status in waitpid()