Remove AutoClosable support to avoid Java7 dep