keyboard: re-add code to detect lid state and handle lights

Depends on libhardware patch for the light ids:
http://review.cyanogenmod.org/77944

This squashes the following commits from cm-11.0 and updates
them for cm-12.0:

From: Dave Daynard <nardholio@gmail.com>
Date: Tue, 19 Nov 2013 18:22:45 -0500
Subject: keyboard: re-add code to detect lid state

keyboard: re-add code to detect lid state

This was lost in the cm-11 merge. Without this, a change in lid state
isn't generated to light up the keyboard backlight

Change-Id: Ief35cebcb62da13afe1ae7531d69ab58e196be9e

From: YuanQY <yuanqingyun@gmail.com>
Date: Fri, 8 Feb 2013 10:59:22 +0800
Subject: Keyboard light: Fix the physical keyboard not light when

Keyboard light: Fix the physical keyboard not light when it's visiable.

Change-Id: I595afd3cb6b422a17ae0f6ec20aa51979db13810

From: tbalden <illespal@gmail.com>
Date: Sun, 31 Mar 2013 18:33:53 +0200
Subject: keyboard: adding functional alt/shift lights

keyboard: adding functional alt/shift lights

This is useful for devices that has QWERTY keyboard
and leds for the Alt/Shift (Fn/Caps) keys, like
htc doubleshot.

Change-Id: I66ebc2d881438f5b51db77eaa885421e65a7da0d