This reverts commit 300992203a to
fix a problem with `esp32-devkitc:blewifi`, which fails to boot up
if `CONFIG_DEBUG_ASSERTIONS=y`.
Introduced by https://github.com/apache/nuttx/pull/16176 with the
following description:
> The DEBUGASSERTS in nxsem_wait and nxsem_trywait are
non-functional, they don't check anything. These were broken in
previous commits.
The above statements are not valid. Originally, there was no
problem calling `nxsem_trywait` from the interrupt and the
`DEBUGASSERT` simply checked a corner case: if ran from the
interrupt context, the current (interrupted) task may be the idle
task. This case is allowed only if called from an interrupt and
that's what the original commit checks with:
```
DEBUGASSERT(!OSINIT_IDLELOOP() || !sched_idletask() ||
up_interrupt_context());
```