std::os: pass the correct buffer size to windows calls.

Previously this was not passing the increased buffer size to the
closure (which normally contains a windows API call), so something that
was classed as too large for the buffer on the first call would be
always classed as too large, and would cause the program to loop
infinitely (or until OOM, since it was allocating double the memory at
each step).