This is a followup on WT-7143, to fix the condition for sweeping cached dhandles.
The failure shows this message just before the assertion:
file:collection-1555--9071490919115203702.wt: current dhandle may be swept: flags 0x108 inuse 0x1 ref 0x3 xref 0x0 WT_CURSOR.close: __curfile_reopen, 633: can_reopen || dhandle != session->dhandle"}