Message dialog: set buttons text before layout occurs, so that buttons get the proper size. Fixes #1764