Make sure close is always called
assert not null in constructor, not at close
Move call to close to a finally block
Move close into finally block
Just close the lookupCursor, not the whole cursor
Handle closed lookupCursor
fixed some indentation
comment
Just close the input not the whole cursor
Moved close into finally block
Always set cursor to null

because otherwise we may try to close a closed cursor if the next
method fails, and close() gets called later
Set cursors to null after closing

we check for nullness before closing, so when closed, set them
to null in a finally block.
check if cursor is already closed
Cleaned up SorterToCursorAdapter closing input
Check that cursor is not closed before closing
Move input closing out of sorter adapter
failing test
added fix suggested by scott
Added postgres test
Removed unnecessary tables from test