Add generic wrapper for java.lang.AutoCloseable