worker: flush messages written by child processes before exit
I found some child outputs were lost while testing the previous patch. Since
os._exit() does nothing special, we need to do that explicitly.
## Avoid interference from actual test env:unset HGTEST_JOBSunset HGTEST_TIMEOUTunset HGTEST_PORTunset HGTEST_SHELL