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