Don't swallow underlying exception if there is an exception closing the cursor on PostgreSQL (Fixes #761)