While the code was using the pattern to cancel the operation, it was still resolving the user_data pointer even in the case the operation has been cancelled. Fix this by simply moving the initialization. Fixes: #1260
This reduces some redundancy between the screen brightness and keyboard brightness code. Such refactoring is a prerequisite for including a keyboard backlight control in the Keyboard panel, as has been [proposed][1]. But hopefully this makes the code a bit neater and more managable even without that. [1]: https://gitlab.gnome.org/Teams/Design/settings-mockups/-/blob/master/keyboard/Keyboard-with-dialogs.png