lightd: code cleanups