Fix a bug with index cursors that could lead to cursors not being automatically closed by WT_SESSION::close.