[SPARK-4606] Send EOF to child JVM when there's no more data to read.

Kind of nitpicky, but I'd probably explicitly name the boolean parameter here (IntelliJ complains otherwise, and besides, it's a nice practice).  I can fix this up myself on merge, though.