Several fixes for getopt

This pull request fixes several getopt bugs/enhancements (see commit messages starting with 'Fix issue' ) for getopt.

The updated documentation is at http://jkm.github.com/phobos/phobos-prerelease/std_getopt.html