Fixed PHP-1267: Windows Build Failure
Rename variable to be consistent with its friends
Reduce the size of the buffer, to_read*2 seems like a good fit

Also remove unnecessary MIN() checks
PHP-1267: Fix header includes
Merge pull request #758 from bjori/windows-buildfix

Fix build on windows

* bjori/windows-buildfix:
  PHP-1267: Fix header includes
  Reduce the size of the buffer, to_read*2 seems like a good fit
  Rename variable to be consistent with its friends
  Fixed PHP-1267: Windows Build Failure