tests: fix child-process-fork-dgram on SmartOS.

Send messages until both the parent and the child process have received
at least one message. If at least one of them doesn't receive any
message, the test runner will make the test timeout.

Fixes #8046.
Merge remote-tracking branch 'upstream/v0.10' into v0.10