Small optimization to how error and message dialogs get shown