lock: add some debugging
lock: ensure that dim stops before end of period

Otherwise, we have concurrent xbacklight processes
lock: avoid race condition with xbacklight
lock: set minimum brightness to 1

This is done to avoid turning off the screen.
lock: workaround race condition with dimming

For some reason, the race condition is here. Dunno how to fix it. Just
workaround it with another race condition... :(