Fix wiredtiger read loop