use File event to wait for sandbox response

- check process state before reading

- handle invalid process output

- use scope (exit) hook to kill process