red-stack: Reorder startup sequence to allow for proper shutdown

Also remove stack from hardware subsystem before destroying it.

Destroy mutex and semaphore on shutdown.