Fix bug #68095 - invalid read in php_getopt()

It's a hacky solution and incomplete, but I don't see other way
without refactoring the whole getopt protocol.
Merge branch 'PHP-5.5' into PHP-5.6

* PHP-5.5:
  Fix bug #68095 - invalid read in php_getopt()