net: coap: Fix Coap coap_option_value_to_int and coap_append_option_int
net: coap: Fix Coap coap_option_value_to_int and coap_append_option_int

In coap_option_value_to_int function, when coap option length is 4,
option->value[3] should be shifted by 0 rather than option->value[2].
This doesn't affect the behavior of function but needs to be fixed.

In coap_append_option_int function, when the value is between 0xffff
and 0xffffff(when option length is 3), bit shift operation is wrong.
For example, if the value is 0xABCDEF, by sys_put_be16(val, data)
data[0]=0xCD, data[1]=0xEF, by val >> 16, data[2]=0xAB. So the result
becomes 0xCDEFAB not 0xABCDEF. So, to sys_put_be16 function hand
&data[1] over instead of handing data over and val >> 16 needs to be
set to data[0], not data[2].

Signed-off-by: Taehwa Kang <6c45e3f1e32e3fcd8a41bc63b9d79658c8c261af@gmail.com>

explora26/zephyr,galak/zephyr,galak/zephyr,Vudentz/zephyr,finikorg/zephyr,ldts/zephyr,Vudentz/zephyr,explora26/zephyr,nashif/zephyr,finikorg/zephyr,punitvara/zephyr,punitvara/zephyr,zephyrproject-rtos/zephyr,finikorg/zephyr,nashif/zephyr,punitvara/zephyr,Vudentz/zephyr,galak/zephyr,punitvara/zephyr,explora26/zephyr,galak/zephyr,Vudentz/zephyr,zephyrproject-rtos/zephyr,ldts/zephyr,zephyrproject-rtos/zephyr,nashif/zephyr,finikorg/zephyr,ldts/zephyr,zephyrproject-rtos/zephyr,zephyrproject-rtos/zephyr,GiulianoFranchetto/zephyr,explora26/zephyr,ldts/zephyr,ldts/zephyr,punitvara/zephyr,nashif/zephyr,galak/zephyr,finikorg/zephyr,explora26/zephyr,GiulianoFranchetto/zephyr,Vudentz/zephyr,Vudentz/zephyr,nashif/zephyr,GiulianoFranchetto/zephyr,GiulianoFranchetto/zephyr,GiulianoFranchetto/zephyr