Declaring a cursor WITH HOLD means it can be used outside transactions, but it seems like the server-side cursors are already set up WITH HOLD when autocommit is on:
So I'm guessing maybe you've disabled transaction management entirely (AUTOCOMMIT=False)? In that case, you could try enabling autocommit manually when you need to use .iterator(), but maybe the backend could check "connection.autocommit or not connection.in_atomic_block" when setting WITH HOLD, so even if autocommit is off, WITH HOLD would be used if not using an atomic block?
As for the behavior when trying to iterate a cursor after the transaction has been exited, I'd expect an error. The cursor should be destroyed at the end of the transaction (unless WITH HOLD was used, which it shouldn't be inside a transaction), so trying to FETCH from it should raise an error.
Dan