net: dns: Check address family when initializing
net: dns: Check address family when initializing

It is be possible that the local address was not properly
resolved in which case the local_addr variable could be NULL.
This will cause NULL pointer access if the variable is used.

Coverity-CID: 173656

Signed-off-by: Jukka Rissanen <f9f077d1da4c7aa947f9864fa5a28c3588f6a45d@linux.intel.com>

galak/zephyr,fbsder/zephyr,galak/zephyr,finikorg/zephyr,nashif/zephyr,finikorg/zephyr,explora26/zephyr,Vudentz/zephyr,explora26/zephyr,rsalveti/zephyr,GiulianoFranchetto/zephyr,zephyrproject-rtos/zephyr,nashif/zephyr,nashif/zephyr,aceofall/zephyr-iotos,aceofall/zephyr-iotos,kraj/zephyr,zephyrproject-rtos/zephyr,punitvara/zephyr,GiulianoFranchetto/zephyr,aceofall/zephyr-iotos,rsalveti/zephyr,zephyriot/zephyr,zephyrproject-rtos/zephyr,aceofall/zephyr-iotos,Vudentz/zephyr,mbolivar/zephyr,kraj/zephyr,fbsder/zephyr,galak/zephyr,zephyriot/zephyr,galak/zephyr,fbsder/zephyr,GiulianoFranchetto/zephyr,runchip/zephyr-cc3220,punitvara/zephyr,nashif/zephyr,GiulianoFranchetto/zephyr,rsalveti/zephyr,mbolivar/zephyr,finikorg/zephyr,runchip/zephyr-cc3220,galak/zephyr,explora26/zephyr,nashif/zephyr,ldts/zephyr,kraj/zephyr,ldts/zephyr,mbolivar/zephyr,Vudentz/zephyr,runchip/zephyr-cc3220,ldts/zephyr,zephyriot/zephyr,ldts/zephyr,fbsder/zephyr,finikorg/zephyr,aceofall/zephyr-iotos,Vudentz/zephyr,runchip/zephyr-cc3220,fbsder/zephyr,ldts/zephyr,Vudentz/zephyr,mbolivar/zephyr,GiulianoFranchetto/zephyr,explora26/zephyr,zephyriot/zephyr,zephyrproject-rtos/zephyr,punitvara/zephyr,zephyriot/zephyr,finikorg/zephyr,zephyrproject-rtos/zephyr,Vudentz/zephyr,rsalveti/zephyr,rsalveti/zephyr,kraj/zephyr,punitvara/zephyr,kraj/zephyr,explora26/zephyr,runchip/zephyr-cc3220,punitvara/zephyr,mbolivar/zephyr