catch uncaught UnsupportedOperationException and rethrow as IOException in close()