keystore: Fix build with gcc 4.7+ -Werror

Fix code fragments that are errors in ISO C++11 mode,
and cause warnings in gcc 4.7+ -Werror (narrowing
conversions inside {})

Change-Id: I878687e1daf99efddc353040805947e26435e535
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>