Support M1 Macs using DisplayServicesGetBrightness/DisplayServicesSetBrightness
Support M1 Macs using DisplayServicesGetBrightness/DisplayServicesSetBrightness

- Tested on a M1 MacBook Air running Big Sur, for the built-in display.
- Extracted functions from the main loop to avoid it getting too complicated.
- Also made minor changes to fix a warning about `brightness` being uninitialized.

nriley/brightness