Fix for callback button index for common buttons

Unfortunately, for now, there's no indication if the dialog was closed
via Alt-F4 or something, it will simply be reported as if the Cancel
button was clicked.