pwrctl lid-open is always called with argument "ac"
regardless of power state. Reason: inside the main
polling loop in main(), the variable 'ac' (argument
count passed by the shell) is used.
Changing this to 'powerstate' (global; last poll time's
power state)
is a quick fix. If we want to catch power state
changing across sleep, we'd need to run a poll after
lid open.
Cheers,
Michael