stdout and stderr should be made O_NONBLOCK so that we don't end up blocking