Make Channel and Connection implement AutoCloseable for use in try-with-resources