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
(cherry picked from commit c172ae05a91c1285142e6c5589458cc0d87dab5d)
Merge "PhoneWindowPolicy: Fix NPE race condition by excessive screen on delay" into cm-11.0
(cherry picked from commit ff1a9712ab6b7f8817559360824e33bb04b777c2)
Another minor speed tweak

(cherry picked from commit 92cb40f569d929fe63706d5b7e63bb5772a7a57f)
Frameworks: Clear Recents position - 2/2

(cherry picked from commit 52043348464709ad20b0d99ee9d57092718b80f1)
Update TRDS with google UI changes for 4.4

(cherry picked from commit 618234c53dca4356efa6ce1acf00a3b0d471742e)