ztest: do teardown in main thread
ztest: do teardown in main thread

If the test exits from some APIs like ztest_test_pass(),
ztest_test_skip(), or a test crashes out, the teardown
function is never run.

Fixes: #16329

Signed-off-by: Andrew Boie <aab045b28152628be6af0e556050d0381fd0a34d@intel.com>

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