Crash fix in key bindings dialog.

Fixes #8762