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.