Delete temporary files after they are used

This patch explicitly deletes temporary files after they have been read. This is required as using `deleteOnExit` does not seem to take effect when the JVM created by rJava exits.

cc @zhangyouhua
Very minor thing: for clarity can we specify the boolean return type `def hasNext: Boolean = { ... }`? Otherwise by Scala convention `def ... = { ` is usually returning a Unit.