Fix HTC headset handling.

HTC's headset driver adds additional bits to the switch state, which
we're unable to deal with. Fix that by masking out those bits and
keeping only the valid ones.

Change-Id: Idd4c050b0497f7ef4373ec3cb5e5f26cfe12643d
Merge "Fix HTC headset handling." into kitkat