PHP-993: Merge return array of individual batches into one array
Fix zts build
Attempt#2 to modify the batch statistics according to the spec
Simplify free()ing logic
New test
Convert empty batches into a NOOP
CS as per PR comments
Add space after "switch" and "while" before "(", as per PR review

Fix it everywhere while I am at it
Merge pull request #593 from bjori/PHP-993-merge-error-batches

PHP-993: Merge return array of individual batches into one array

* bjori/PHP-993-merge-error-batches:
  Add space after "switch" and "while" before "(", as per PR review
  CS as per PR comments
  Convert empty batches into a NOOP
  New test
  Simplify free()ing logic
  Attempt#2 to modify the batch statistics according to the spec
  Fix zts build
  PHP-993: Merge return array of individual batches into one array