Avoid accessing invalid iterator at end of read ahead.
Avoid accessing invalid iterator at end of read ahead.

Fix for #5070.

robertjpayne/rethinkdb,niieani/rethinkdb,dparnell/rethinkdb,bpradipt/rethinkdb,grandquista/rethinkdb,grandquista/rethinkdb,eliangidoni/rethinkdb,mbroadst/rethinkdb,catroot/rethinkdb,Qinusty/rethinkdb,Qinusty/rethinkdb,bchavez/rethinkdb,catroot/rethinkdb,eliangidoni/rethinkdb,robertjpayne/rethinkdb,robertjpayne/rethinkdb,eliangidoni/rethinkdb,catroot/rethinkdb,robertjpayne/rethinkdb,bpradipt/rethinkdb,grandquista/rethinkdb,dparnell/rethinkdb,Qinusty/rethinkdb,mbroadst/rethinkdb,Qinusty/rethinkdb,jmptrader/rethinkdb,eliangidoni/rethinkdb,mbroadst/rethinkdb,niieani/rethinkdb,dparnell/rethinkdb,JackieXie168/rethinkdb,Qinusty/rethinkdb,Qinusty/rethinkdb,bchavez/rethinkdb,robertjpayne/rethinkdb,eliangidoni/rethinkdb,grandquista/rethinkdb,bchavez/rethinkdb,JackieXie168/rethinkdb,robertjpayne/rethinkdb,jmptrader/rethinkdb,catroot/rethinkdb,bchavez/rethinkdb,JackieXie168/rethinkdb,mbroadst/rethinkdb,mbroadst/rethinkdb,Qinusty/rethinkdb,catroot/rethinkdb,JackieXie168/rethinkdb,dparnell/rethinkdb,jmptrader/rethinkdb,grandquista/rethinkdb,mbroadst/rethinkdb,niieani/rethinkdb,dparnell/rethinkdb,JackieXie168/rethinkdb,dparnell/rethinkdb,jmptrader/rethinkdb,catroot/rethinkdb,JackieXie168/rethinkdb,robertjpayne/rethinkdb,dparnell/rethinkdb,grandquista/rethinkdb,bpradipt/rethinkdb,dparnell/rethinkdb,robertjpayne/rethinkdb,Qinusty/rethinkdb,bchavez/rethinkdb,bchavez/rethinkdb,bpradipt/rethinkdb,catroot/rethinkdb,catroot/rethinkdb,grandquista/rethinkdb,bpradipt/rethinkdb,jmptrader/rethinkdb,niieani/rethinkdb,bchavez/rethinkdb,niieani/rethinkdb,bpradipt/rethinkdb,mbroadst/rethinkdb,JackieXie168/rethinkdb,eliangidoni/rethinkdb,robertjpayne/rethinkdb,bpradipt/rethinkdb,dparnell/rethinkdb,bchavez/rethinkdb,grandquista/rethinkdb,eliangidoni/rethinkdb,niieani/rethinkdb,mbroadst/rethinkdb,niieani/rethinkdb,grandquista/rethinkdb,jmptrader/rethinkdb,JackieXie168/rethinkdb,mbroadst/rethinkdb,Qinusty/rethinkdb,niieani/rethinkdb,jmptrader/rethinkdb,bpradipt/rethinkdb,jmptrader/rethinkdb,eliangidoni/rethinkdb,JackieXie168/rethinkdb,bchavez/rethinkdb,eliangidoni/rethinkdb,bpradipt/rethinkdb