Revert "use rtgui_app to represent threads"

This reverts commit 6a181b9f0b08b547cce89ba282d46299ed549f7d and
483ebf7b51c2ba08624a451c2ed670dc364da042. The app branch is not ready
right now.