refactor; end event for child_process is always close for node 0.8+