Previously, the function returned true when node->next == NULL, but did
not verify that node->previous was also NULL.
The updated implementation checks the node->next == NULL and in
RTEMS_DEBUG it checks node->previous == NULL before reporting the
node is off-chain.
These changes ensure that the off-chain invariant is verified in
the RTEMS_DEBUG
This change Updates RTEMS issue #4812.