Windows: refactor cm_GetBuffer avoid BIOD construction
Constructing a BIOD is a very expensive operation as it requires
obtaining exclusive locks on each and every buffer that in the
collection. The prior code would construct a BIOD for a chunk
worth of buffers and then check to see if the current buffer is
beyond the serverLength or the truncation position. If so, the
buffer is cleared and the buffer is returned as current after
releasing the BIOD. This is very wasteful. Instead, check every
buffer in the BIOD to see if it should be made current or not.
If yes, do so before releasing the BIOD. This permits the construction
of the BIOD to be avoided for the rest of the buffers in the chunk.