sensors: fix klockwork reported errors
sensors: fix klockwork reported errors

- add NULL check when de-referencing and using a pointer variable.

Change-Id: I37438102fbc86b361355d1ba0abcecfbfee04e3a

TheStrix/platform-hardware-qcom-sensors,dianlujitao/platform_hardware_qcom_sensors,redmi2/android_hardware_qcom_sensors,TheStrix/platform-hardware-qcom-sensors,redmi2/android_hardware_qcom_sensors,dianlujitao/platform_hardware_qcom_sensors