PID-File generation, fix some warnings

These two commits add:
- pid file generation via libbsd
- only one daemon is allowed to run
- fix warnings and check if keyboard/screen backlight setting worked