Selectmenu: Prevent exception when the user types in selectmenu, when the result is an optgroup

Hi!

This PR is probably done somewhat wrong, but I thought I should get this in before the weekend.

Ticket: http://bugs.jqueryui.com/ticket/10571

If you have a Selectmenu with ``optgroup``s, and type while it has focus, it may hit an ``optgroup`` as a result. If this happens, you get an exception.

Fiddle: http://jsfiddle.net/coLcs5pz/1/

Just put focus on the selectmenu, and type ``S``, and you'll get an exception in the console.
``Uncaught TypeError: Cannot read property 'index' of undefined ``

There is probably some better way to solve this problem, but this fixes it for us at least.
This should verify that the correct element is provided, not just that it's a menu item.