nodejs wrapper to waitpid system function.