Add casts to avoid build warnings with gcc-4.7

Example:
keystore.cpp:1339:35: error: narrowing conversion of 'CommandCodes[0]'
from 'command_code_t {aka unsigned char}' to 'int8_t {aka signed char}'

Change-Id: I8cd239880821724050d1716b78851807e0246ef2
Signed-off-by: Pavel Chupin <pavel.v.chupin@intel.com>
Switch keystore to binder

Change-Id: I6dacdc43bcc1a56e47655e37e825ee6a205eb56b
EINTR handling and debugging for error cases

Some interruptable syscalls were not wrapped with TEMP_FAILURE_RETRY
while others were. Add them where necessary.

Additionally, some error cases were not logging any messages so things
would mysteriously fail if there was an underlying filesystem problem.

Change-Id: I0b789376b2971fa8aaaff7eac21a90a9a94afac8
Bring in keystore from cm. credit cm and caf

Change-Id: Ie51ba903701d1120828027b5ccabe51e0d95b2b2
Fix compilation errors with linaro

Change-Id: I019eec29d61cb330ab0b08fdb890ef3c07b701ae