[rex select] optgroup backport (fixes #39)

fixes https://github.com/redaxo/redaxo4/issues/39