Fix CmdLineParser.MyParser to not throw ClassCastException
Fix CmdLineParser.MyParser to not throw ClassCastException

MyParser.options can also hold objects of type OptionDef and resulting
in ClassCastException when those type of objects are being casted to
NamedOptionDef. In this change, object type is checked before casting.

Change-Id: I273233133be48fa4e2c0b6ebe4737d21307b605d

GerritCodeReview/gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit,GerritCodeReview/gerrit