JBIDE-17656 Remove unnecessary System.gc call.

This ensures that GC is not hinted to the JVM when setting file
contents. It is necessary only when attempting to close file
handles after a deletion.

Also fixed a resource leak issue.