use child process close instead of exit to avoid data/exit race condition