backlight: Revamp error handling code to not leak the directory

To neatly free the directory pointer allocated by opendir(), adjust the error
handling paths to go through to the err label.
1 file changed