[java] Fixed EOF catching on the output of sys.io.Process