Fix index out of range issue when parsing global flags

https://github.com/github/hub/issues/698
Merge pull request #699 from github/args_index_out_of_range

Fix index out of range issue when parsing global flags