sensors: fix proximity sensor index exceed boundary issue
sensors: fix proximity sensor index exceed boundary issue

Proximity sensor index value will be any value when no valid
sensor device is found, this may exceed array boundary when use
this index to access array content.

CRs-Fixed: 564778
Change-Id: I77b2484c60852d02c5d9d250ffca7a14ac227f20

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