set_backlight utility to set the backlight PWM

Dimming the display may help save battery
Debugging, cleanup, and pre-exit close fixes