SERVER-10159 Avoid forming past end iterator when reserializing