net: lwm2m: Fix msg find based on pending/reply
net: lwm2m: Fix msg find based on pending/reply

The message should only be returned if the requested pending/reply
pointer is not NULL. Otherwise it could get an incorrect match (for
instance if specific pending pointer is searched for and reply is NULL
the function could return any message that doesn't expect a reply (and
thus has its reply pointer set to NULL).

Signed-off-by: Robert Lubos <9d28997c6894a2d0321a7bb399169af7ce99b64e@nordicsemi.no>

Vudentz/zephyr,galak/zephyr,finikorg/zephyr,Vudentz/zephyr,galak/zephyr,Vudentz/zephyr,nashif/zephyr,zephyrproject-rtos/zephyr,Vudentz/zephyr,zephyrproject-rtos/zephyr,galak/zephyr,finikorg/zephyr,nashif/zephyr,nashif/zephyr,zephyrproject-rtos/zephyr,Vudentz/zephyr,galak/zephyr,galak/zephyr,zephyrproject-rtos/zephyr,zephyrproject-rtos/zephyr,finikorg/zephyr,finikorg/zephyr,nashif/zephyr,Vudentz/zephyr,finikorg/zephyr,nashif/zephyr