net: lwm2m: dont use system workqueue for services
net: lwm2m: dont use system workqueue for services

"It's a Trap!" -- Admiral Ackbar

When moving to the BSD-socket APIs, the original thread running LwM2M
periodic services such as observes and lifetime updates, was replaced
with a re-occuring workqueue job.  To save the overhead of creating a
new thread, I used the system workqueue for these jobs.

This was a mistake.  If these jobs hit a semaphore or wait for some
reason, it cannot be prempted due to the priority of the system work
queue.

Let's instead add this service handling to the thread that we already
use for polling sockets.  This also removes a configuration issue where
the system workqueue stack size needed to be increased.  This can now
be adjusted via the LWM2M_ENGINE_STACK_SIZE knob.

Directly fixes semaphore usage in the socket-based DNS code.
This was introduced as a bugfix for non-responsive DNS server hanging
the Zephyr device forever.  However, this probably fixes randomly
seeming hangs on the device.

Signed-off-by: Michael Scott <a17fed27eaa842282862ff7c1b9c8395a26ac320@foundries.io>

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