frameworks/base: Fix various aliasing violations

Signed-off-by: Amit Pundir <amit.pundir@linaro.org>