fixing interoperability with native child_process. also added tests

calling `waitpid` when it was one of node's processes caused failure. This fixes it.

Should we perhaps use another map? Is there any case where SIGCHLD would be called multiple times for a single process, such that we would set the pidMap entry, and then not pay attention to successive events?