removing a deadlock etc

...gchld handler to child process to avoid deadlock in malloc; (3) continue if sigchld triggered but found no child.