Add an AutoCloseable with subclasser-specified exception type